{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import gym"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[33mWARN: gym.spaces.Box autodetected dtype as <class 'numpy.float32'>. Please provide explicit dtype.\u001b[0m\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/tom/work/library/gym/gym/__init__.py:22: UserWarning: DEPRECATION WARNING: to improve load times, gym no longer automatically loads gym.spaces. Please run \"import gym.spaces\" to load gym.spaces on your own. This warning will turn into an error in a future version of gym.\n",
      "  warnings.warn('DEPRECATION WARNING: to improve load times, gym no longer automatically loads gym.spaces. Please run \"import gym.spaces\" to load gym.spaces on your own. This warning will turn into an error in a future version of gym.')\n"
     ]
    }
   ],
   "source": [
    "env = gym.make('CartPole-v0')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(array([ 0.01090029,  0.15549364,  0.01198966, -0.32865213]), 1.0, False, {})\n",
      "(array([ 0.01401016, -0.03979692,  0.00541662, -0.03221246]), 1.0, False, {})\n",
      "(array([ 0.01321423,  0.15524694,  0.00477237, -0.32318148]), 1.0, False, {})\n",
      "(array([ 0.01631916, -0.03994265, -0.00169126, -0.02899737]), 1.0, False, {})\n",
      "(array([ 0.01552031, -0.2350403 , -0.00227121,  0.26315146]), 1.0, False, {})\n",
      "(array([ 0.01081951, -0.43012976,  0.00299182,  0.55511716]), 1.0, False, {})\n",
      "(array([ 0.00221691, -0.23504994,  0.01409416,  0.26337834]), 1.0, False, {})\n",
      "(array([-0.00248409, -0.43037021,  0.01936173,  0.56047318]), 1.0, False, {})\n",
      "(array([-0.01109149, -0.23552527,  0.03057119,  0.27395255]), 1.0, False, {})\n",
      "(array([-0.015802  , -0.04085255,  0.03605024, -0.00893355]), 1.0, False, {})\n",
      "(array([-0.01661905, -0.23647247,  0.03587157,  0.29490215]), 1.0, False, {})\n",
      "(array([-0.0213485 , -0.43208698,  0.04176961,  0.59867913]), 1.0, False, {})\n",
      "(array([-0.02999024, -0.62776771,  0.0537432 ,  0.9042209 ]), 1.0, False, {})\n",
      "(array([-0.04254559, -0.43341322,  0.07182762,  0.62890298]), 1.0, False, {})\n",
      "(array([-0.05121386, -0.62946017,  0.08440568,  0.94331431]), 1.0, False, {})\n",
      "(array([-0.06380306, -0.43557062,  0.10327196,  0.67830119]), 1.0, False, {})\n",
      "(array([-0.07251447, -0.24202346,  0.11683798,  0.41983524]), 1.0, False, {})\n",
      "(array([-0.07735494, -0.04873408,  0.12523469,  0.16615014]), 1.0, False, {})\n",
      "(array([-0.07832962, -0.24540547,  0.12855769,  0.49556968]), 1.0, False, {})\n",
      "(array([-0.08323773, -0.05230849,  0.13846909,  0.24600635]), 1.0, False, {})\n",
      "(array([-0.0842839 , -0.24910851,  0.14338921,  0.57896081]), 1.0, False, {})\n",
      "(array([-0.08926607, -0.44591801,  0.15496843,  0.9131575 ]), 1.0, False, {})\n",
      "(array([-0.09818443, -0.64275833,  0.17323158,  1.25025827]), 1.0, False, {})\n",
      "(array([-0.1110396 , -0.83962444,  0.19823674,  1.5918134 ]), 1.0, False, {})\n",
      "(array([-0.12783209, -1.03647   ,  0.23007301,  1.93919964]), 1.0, True, {})\n",
      "\u001b[33mWARN: You are calling 'step()' even though this environment has already returned done = True. You should always call 'reset()' once you receive 'done = True' -- any further steps are undefined behavior.\u001b[0m\n",
      "(array([-0.14856149, -0.84442655,  0.26885701,  1.72577135]), 0.0, True, {})\n",
      "(array([-0.16545002, -1.04143222,  0.30337243,  2.08875888]), 0.0, True, {})\n",
      "(array([-0.18627866, -1.23808712,  0.34514761,  2.45810035]), 0.0, True, {})\n",
      "(array([-0.21104041, -1.43413858,  0.39430962,  2.83430515]), 0.0, True, {})\n",
      "(array([-0.23972318, -1.24315497,  0.45099572,  2.68275952]), 0.0, True, {})\n",
      "(array([-0.26458628, -1.0532384 ,  0.50465091,  2.5545117 ]), 0.0, True, {})\n",
      "(array([-0.28565104, -1.24802011,  0.55574114,  2.95241256]), 0.0, True, {})\n",
      "(array([-0.31061145, -1.05869491,  0.6147894 ,  2.86626866]), 0.0, True, {})\n",
      "(array([-0.33178534, -1.25126355,  0.67211477,  3.2718064 ]), 0.0, True, {})\n",
      "(array([-0.35681062, -1.06199541,  0.7375509 ,  3.23270784]), 0.0, True, {})\n",
      "(array([-0.37805052, -1.25114029,  0.80220505,  3.64040039]), 0.0, True, {})\n",
      "(array([-0.40307333, -1.06107749,  0.87501306,  3.65357863]), 0.0, True, {})\n",
      "(array([-0.42429488, -0.87120064,  0.94808463,  3.69667605]), 0.0, True, {})\n",
      "(array([-0.44171889, -1.05348659,  1.02201815,  4.0949669 ]), 0.0, True, {})\n",
      "(array([-0.46278862, -0.86103948,  1.10391749,  4.19521301]), 0.0, True, {})\n",
      "(array([-0.48000941, -1.03636318,  1.18782175,  4.57611854]), 0.0, True, {})\n",
      "(array([-0.50073668, -0.83964604,  1.27934412,  4.73855611]), 0.0, True, {})\n",
      "(array([-0.5175296 , -1.00652991,  1.37411525,  5.09208692]), 0.0, True, {})\n",
      "(array([-0.5376602 , -1.1682125 ,  1.47595698,  5.42781168]), 0.0, True, {})\n",
      "(array([-0.56102445, -0.96086485,  1.58451322,  5.6910376 ]), 0.0, True, {})\n",
      "(array([-0.58024174, -1.11306092,  1.69833397,  5.98187856]), 0.0, True, {})\n",
      "(array([-0.60250296, -1.26109076,  1.81797154,  6.24524836]), 0.0, True, {})\n",
      "(array([-0.62772478, -1.40595018,  1.94287651,  6.47714968]), 0.0, True, {})\n",
      "(array([-0.65584378, -1.18205865,  2.0724195 ,  6.87312718]), 0.0, True, {})\n",
      "(array([-0.67948495, -1.32280683,  2.20988205,  7.02938932]), 0.0, True, {})\n",
      "(array([-0.70594109, -1.09296065,  2.35046983,  7.47100761]), 0.0, True, {})\n",
      "(array([-0.7278003 , -1.23686236,  2.49988998,  7.52832913]), 0.0, True, {})\n",
      "(array([-0.75253755, -1.38804788,  2.65045657,  7.52263881]), 0.0, True, {})\n",
      "(array([-0.78029851, -1.54855465,  2.80090934,  7.44899572]), 0.0, True, {})\n",
      "(array([-0.8112696 , -1.33259246,  2.94988926,  7.85255544]), 0.0, True, {})\n",
      "(array([-0.83792145, -1.51309041,  3.10694037,  7.64278452]), 0.0, True, {})\n",
      "(array([-0.86818326, -1.70572452,  3.25979606,  7.36419255]), 0.0, True, {})\n",
      "(array([-0.90229775, -1.51871176,  3.40707991,  7.60808333]), 0.0, True, {})\n",
      "(array([-0.93267198, -1.34292326,  3.55924157,  7.78538834]), 0.0, True, {})\n",
      "(array([-0.95953045, -1.17907626,  3.71494934,  7.89078356]), 0.0, True, {})\n",
      "(array([-0.98311197, -1.40874069,  3.87276501,  7.44189536]), 0.0, True, {})\n",
      "(array([-1.01128679, -1.26162585,  4.02160292,  7.40984566]), 0.0, True, {})\n",
      "(array([-1.03651931, -1.49493553,  4.16979983,  6.96026899]), 0.0, True, {})\n",
      "(array([-1.06641802, -1.35418374,  4.30900521,  6.81751168]), 0.0, True, {})\n",
      "(array([-1.09350169, -1.21458547,  4.44535545,  6.62930405]), 0.0, True, {})\n",
      "(array([-1.1177934 , -1.07403778,  4.57794153,  6.40135377]), 0.0, True, {})\n",
      "(array([-1.13927416, -0.93073512,  4.7059686 ,  6.13881999]), 0.0, True, {})\n",
      "(array([-1.15788886, -0.78326081,  4.828745  ,  5.8462463 ]), 0.0, True, {})\n",
      "(array([-1.17355407, -0.9945936 ,  4.94566993,  5.59103584]), 0.0, True, {})\n",
      "(array([-1.19344595, -1.20180934,  5.05749064,  5.37685272]), 0.0, True, {})\n",
      "(array([-1.21748213, -1.03920081,  5.1650277 ,  5.01767281]), 0.0, True, {})\n",
      "(array([-1.23826615, -1.23895131,  5.26538116,  4.88431806]), 0.0, True, {})\n",
      "(array([-1.26304518, -1.0663694 ,  5.36306752,  4.49816749]), 0.0, True, {})\n",
      "(array([-1.28437256, -1.2612579 ,  5.45303087,  4.44131331]), 0.0, True, {})\n",
      "(array([-1.30959772, -1.4556914 ,  5.54185713,  4.42112528]), 0.0, True, {})\n",
      "(array([-1.33871155, -1.27241853,  5.63027964,  4.01983096]), 0.0, True, {})\n",
      "(array([-1.36415992, -1.08501392,  5.71067626,  3.61793744]), 0.0, True, {})\n",
      "(array([-1.3858602 , -1.27641332,  5.78303501,  3.69998461]), 0.0, True, {})\n",
      "(array([-1.41138846, -1.46866991,  5.8570347 ,  3.8120555 ]), 0.0, True, {})\n",
      "(array([-1.44076186, -1.66183904,  5.93327581,  3.95436427]), 0.0, True, {})\n",
      "(array([-1.47399864, -1.46898674,  6.01236309,  3.58182805]), 0.0, True, {})\n",
      "(array([-1.50337838, -1.27453472,  6.08399965,  3.22212934]), 0.0, True, {})\n",
      "(array([-1.52886907, -1.46832406,  6.14844224,  3.44889183]), 0.0, True, {})\n",
      "(array([-1.55823555, -1.66283899,  6.21742008,  3.69852487]), 0.0, True, {})\n",
      "(array([-1.59149233, -1.8578359 ,  6.29139058,  3.97106689]), 0.0, True, {})\n",
      "(array([-1.62864905, -2.05294832,  6.37081191,  4.26613799]), 0.0, True, {})\n",
      "(array([-1.66970802, -2.24765752,  6.45613467,  4.58281048]), 0.0, True, {})\n",
      "(array([-1.71466117, -2.44126505,  6.54779088,  4.91948327]), 0.0, True, {})\n",
      "(array([-1.76348647, -2.24457268,  6.64618055,  4.71160273]), 0.0, True, {})\n",
      "(array([-1.80837792, -2.04833144,  6.7404126 ,  4.54081454]), 0.0, True, {})\n",
      "(array([-1.84934455, -1.8527982 ,  6.83122889,  4.40743225]), 0.0, True, {})\n",
      "(array([-1.88640052, -1.65804822,  6.91937754,  4.3112697 ]), 0.0, True, {})\n",
      "(array([-1.91956148, -1.46401783,  7.00560293,  4.25183938]), 0.0, True, {})\n",
      "(array([-1.94884184, -1.27053736,  7.09063972,  4.22850598]), 0.0, True, {})\n",
      "(array([-1.97425258, -1.07735458,  7.17520984,  4.24059724]), 0.0, True, {})\n",
      "(array([-1.99579968, -0.88415003,  7.26002178,  4.2874789 ]), 0.0, True, {})\n",
      "(array([-2.01348268, -1.06211749,  7.34577136,  4.68052428]), 0.0, True, {})\n",
      "(array([-2.03472503, -1.23500937,  7.43938185,  5.06356516]), 0.0, True, {})\n",
      "(array([-2.05942521, -1.40227116,  7.54065315,  5.43372229]), 0.0, True, {})\n",
      "(array([-2.08747064, -1.56351791,  7.6493276 ,  5.78795913]), 0.0, True, {})\n",
      "(array([-2.11874099, -1.71861262,  7.76508678,  6.12310323]), 0.0, True, {})\n",
      "(array([-2.15311325, -1.86774324,  7.88754884,  6.4358016 ]), 0.0, True, {})\n",
      "(array([-2.19046811, -2.0114913 ,  8.01626488,  6.7223995 ]), 0.0, True, {})\n",
      "(array([-2.23069794, -1.78659938,  8.15071287,  7.06704093]), 0.0, True, {})\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(array([-2.26642993, -1.92205187,  8.29205369,  7.28878374]), 0.0, True, {})\n",
      "(array([-2.30487096, -1.68849872,  8.43782936,  7.70362956]), 0.0, True, {})\n",
      "(array([-2.33864094, -1.82192112,  8.59190195,  7.8386065 ]), 0.0, True, {})\n",
      "(array([-2.37507936, -1.58480661,  8.74867408,  8.29540649]), 0.0, True, {})\n",
      "(array([-2.40677549, -1.72684816,  8.91458221,  8.31318739]), 0.0, True, {})\n",
      "(array([-2.44131245, -1.49670439,  9.08084596,  8.7580138 ]), 0.0, True, {})\n",
      "(array([-2.47124654, -1.27365276,  9.25600623,  9.17213136]), 0.0, True, {})\n",
      "(array([-2.4967196 , -1.45224482,  9.43944886,  8.95743313]), 0.0, True, {})\n",
      "(array([-2.52576449, -1.25848467,  9.61859752,  9.24372899]), 0.0, True, {})\n",
      "(array([-2.55093419, -1.08260701,  9.8034721 ,  9.44597886]), 0.0, True, {})\n",
      "(array([-2.57258633, -1.31253896,  9.99239168,  9.01682357]), 0.0, True, {})\n",
      "(array([-2.59883711, -1.16958573, 10.17272815,  9.03956716]), 0.0, True, {})\n",
      "(array([-2.62222882, -1.41768187, 10.3535195 ,  8.56679356]), 0.0, True, {})\n",
      "(array([-2.65058246, -1.66539839, 10.52485537,  8.10882398]), 0.0, True, {})\n",
      "(array([-2.68389043, -1.90931332, 10.68703185,  7.68086563]), 0.0, True, {})\n",
      "(array([-2.72207669, -1.7816588 , 10.84064916,  7.45889645]), 0.0, True, {})\n",
      "(array([-2.75770987, -1.65163857, 10.98982709,  7.19851204]), 0.0, True, {})\n",
      "(array([-2.79074264, -1.88064108, 11.13379733,  6.90254272]), 0.0, True, {})\n",
      "(array([-2.82835546, -2.10382504, 11.27184818,  6.65747332]), 0.0, True, {})\n",
      "(array([-2.87043196, -1.95651728, 11.40499765,  6.31434993]), 0.0, True, {})\n",
      "(array([-2.90956231, -2.16900179, 11.53128465,  6.17152775]), 0.0, True, {})\n",
      "(array([-2.95294234, -2.37844953, 11.6547152 ,  6.07908485]), 0.0, True, {})\n",
      "(array([-3.00051133, -2.21247488, 11.7762969 ,  5.6941986 ]), 0.0, True, {})\n",
      "(array([-3.04476083, -2.41540501, 11.89018087,  5.69957068]), 0.0, True, {})\n",
      "(array([-3.09306893, -2.23819531, 12.00417229,  5.30825242]), 0.0, True, {})\n",
      "(array([-3.13783284, -2.05506631, 12.11033733,  4.91912233]), 0.0, True, {})\n",
      "(array([-3.17893416, -2.25211805, 12.20871978,  5.05501908]), 0.0, True, {})\n",
      "(array([-3.22397653, -2.44949454, 12.30982016,  5.22942742]), 0.0, True, {})\n",
      "(array([-3.27296642, -2.25852223, 12.41440871,  4.87774329]), 0.0, True, {})\n",
      "(array([-3.31813686, -2.06509244, 12.51196358,  4.54643718]), 0.0, True, {})\n",
      "(array([-3.35943871, -1.87033052, 12.60289232,  4.23873881]), 0.0, True, {})\n",
      "(array([-3.39684532, -2.06531672, 12.6876671 ,  4.54175807]), 0.0, True, {})\n",
      "(array([-3.43815165, -2.25951814, 12.77850226,  4.86649367]), 0.0, True, {})\n",
      "(array([-3.48334202, -2.0631204 , 12.87583213,  4.64040064]), 0.0, True, {})\n",
      "(array([-3.52460443, -2.2547044 , 12.96864014,  5.00366208]), 0.0, True, {})\n",
      "(array([-3.56969851, -2.44331462, 13.06871339,  5.37909692]), 0.0, True, {})\n",
      "(array([-3.61856481, -2.24403338, 13.17629532,  5.25865994]), 0.0, True, {})\n",
      "(array([-3.66344547, -2.04497041, 13.28146852,  5.1823096 ]), 0.0, True, {})\n",
      "(array([-3.70434488, -2.22436878, 13.38511471,  5.57825933]), 0.0, True, {})\n",
      "(array([-3.74883226, -2.39771099, 13.4966799 ,  5.97058934]), 0.0, True, {})\n",
      "(array([-3.79678648, -2.56399684, 13.61609169,  6.35537511]), 0.0, True, {})\n",
      "(array([-3.84806641, -2.72241573, 13.74319919,  6.7286512 ]), 0.0, True, {})\n",
      "(array([-3.90251473, -2.50514572, 13.87777221,  6.87502848]), 0.0, True, {})\n",
      "(array([-3.95261764, -2.28411753, 14.01527278,  7.0741537 ]), 0.0, True, {})\n",
      "(array([-3.99829999, -2.05852814, 14.15675586,  7.32482727]), 0.0, True, {})\n",
      "(array([-4.03947056, -1.82767602, 14.3032524 ,  7.62555365]), 0.0, True, {})\n",
      "(array([-4.07602408, -1.95541797, 14.45576348,  7.88383004]), 0.0, True, {})\n",
      "(array([-4.11513244, -2.08043638, 14.61344008,  8.10429474]), 0.0, True, {})\n",
      "(array([-4.15674116, -1.83661518, 14.77552597,  8.53325256]), 0.0, True, {})\n",
      "(array([-4.19347347, -1.96191082, 14.94619102,  8.65736506]), 0.0, True, {})\n",
      "(array([-4.23271168, -2.09476982, 15.11933832,  8.71607738]), 0.0, True, {})\n",
      "(array([-4.27460708, -1.85723211, 15.29365987,  9.17565337]), 0.0, True, {})\n",
      "(array([-4.31175172, -2.0121669 , 15.47717294,  9.08126351]), 0.0, True, {})\n",
      "(array([-4.35199506, -2.18502893, 15.65879821,  8.89609698]), 0.0, True, {})\n",
      "(array([-4.39569564, -2.37561872, 15.83672015,  8.62500646]), 0.0, True, {})\n",
      "(array([-4.44320801, -2.19186357, 16.00922028,  8.86060756]), 0.0, True, {})\n",
      "(array([-4.48704528, -2.41235631, 16.18643243,  8.45752761]), 0.0, True, {})\n",
      "(array([-4.53529241, -2.25762652, 16.35558298,  8.52819452]), 0.0, True, {})\n",
      "(array([-4.58044494, -2.11598403, 16.52614687,  8.52027185]), 0.0, True, {})\n",
      "(array([-4.62276462, -2.3604274 , 16.69655231,  8.05504643]), 0.0, True, {})\n",
      "(array([-4.66997317, -2.23135345, 16.85765324,  7.91594328]), 0.0, True, {})\n",
      "(array([-4.71460024, -2.10507092, 17.0159721 ,  7.72505876]), 0.0, True, {})\n",
      "(array([-4.75670166, -2.34372844, 17.17047328,  7.3481566 ]), 0.0, True, {})\n",
      "(array([-4.80357623, -2.5759666 , 17.31743641,  7.01822998]), 0.0, True, {})\n",
      "(array([-4.85509556, -2.80203577, 17.45780101,  6.73756204]), 0.0, True, {})\n",
      "(array([-4.91113627, -3.02259732, 17.59255225,  6.50718019]), 0.0, True, {})\n",
      "(array([-4.97158822, -3.2385089 , 17.72269585,  6.32750388]), 0.0, True, {})\n",
      "(array([-5.0363584 , -3.08241362, 17.84924593,  5.96143807]), 0.0, True, {})\n",
      "(array([-5.09800667, -2.91845268, 17.96847469,  5.58117782]), 0.0, True, {})\n",
      "(array([-5.15637572, -2.74719178, 18.08009825,  5.19091374]), 0.0, True, {})\n",
      "(array([-5.21131956, -2.94638154, 18.18391652,  5.20097792]), 0.0, True, {})\n",
      "(array([-5.27024719, -2.7656352 , 18.28793608,  4.80617317]), 0.0, True, {})\n",
      "(array([-5.32555989, -2.57990483, 18.38405955,  4.41379966]), 0.0, True, {})\n",
      "(array([-5.37715799, -2.77493052, 18.47233554,  4.54324504]), 0.0, True, {})\n",
      "(array([-5.4326566 , -2.58420827, 18.56320044,  4.16898431]), 0.0, True, {})\n",
      "(array([-5.48434077, -2.77909611, 18.64658013,  4.36636958]), 0.0, True, {})\n",
      "(array([-5.53992269, -2.97455473, 18.73390752,  4.59427269]), 0.0, True, {})\n",
      "(array([-5.59941378, -3.17021842, 18.82579297,  4.85188284]), 0.0, True, {})\n",
      "(array([-5.66281815, -3.36553734, 18.92283063,  5.13779285]), 0.0, True, {})\n",
      "(array([-5.7301289 , -3.16965395, 19.02558649,  4.86627971]), 0.0, True, {})\n",
      "(array([-5.79352198, -2.97339922, 19.12291208,  4.62793295]), 0.0, True, {})\n",
      "(array([-5.85298996, -2.77740936, 19.21547074,  4.42423328]), 0.0, True, {})\n",
      "(array([-5.90853815, -2.58207614, 19.3039554 ,  4.25582527]), 0.0, True, {})\n",
      "(array([-5.96017967, -2.38759583, 19.38907191,  4.12275051]), 0.0, True, {})\n",
      "(array([-6.00793159, -2.57686514, 19.47152692,  4.51736194]), 0.0, True, {})\n",
      "(array([-6.05946889, -2.38178036, 19.56187416,  4.4508302 ]), 0.0, True, {})\n",
      "(array([-6.1071045 , -2.56561859, 19.65089076,  4.85169228]), 0.0, True, {})\n",
      "(array([-6.15841687, -2.36860592, 19.74792461,  4.85726129]), 0.0, True, {})\n",
      "(array([-6.20578899, -2.17130112, 19.84506983,  4.90291308]), 0.0, True, {})\n",
      "(array([-6.24921501, -1.97325049, 19.9431281 ,  4.98795981]), 0.0, True, {})\n",
      "(array([-6.28868002, -1.77392657, 20.04288729,  5.1117834 ]), 0.0, True, {})\n",
      "(array([-6.32415855, -1.57274112, 20.14512296,  5.27386148]), 0.0, True, {})\n",
      "(array([-6.35561338, -1.73453573, 20.25060019,  5.62275197]), 0.0, True, {})\n",
      "(array([-6.39030409, -1.89055457, 20.36305523,  5.95206248]), 0.0, True, {})\n",
      "(array([-6.42811518, -1.67729918, 20.48209648,  6.2272617 ]), 0.0, True, {})\n",
      "(array([-6.46166116, -1.45941513, 20.60664171,  6.54086827]), 0.0, True, {})\n",
      "(array([-6.49084947, -1.60091129, 20.73745908,  6.79047098]), 0.0, True, {})\n",
      "(array([-6.52286769, -1.73986272, 20.8732685 ,  7.00482105]), 0.0, True, {})\n",
      "(array([-6.55766495, -1.5096717 , 21.01336492,  7.42027225]), 0.0, True, {})\n",
      "(array([-6.58785838, -1.27515766, 21.16177036,  7.86066634]), 0.0, True, {})\n",
      "(array([-6.61336153, -1.03787689, 21.31898369,  8.31786057]), 0.0, True, {})\n",
      "(array([-6.63411907, -0.80047206, 21.4853409 ,  8.77957409]), 0.0, True, {})\n",
      "(array([-6.65012851, -0.95050247, 21.66093238,  8.72515508]), 0.0, True, {})\n",
      "(array([-6.66913856, -1.11587094, 21.83543549,  8.58583287]), 0.0, True, {})\n",
      "(array([-6.69145598, -1.29732287, 22.00715214,  8.36254287]), 0.0, True, {})\n",
      "(array([-6.71740244, -1.49376244, 22.174403  ,  8.06321641]), 0.0, True, {})\n",
      "(array([-6.74727769, -1.70250569, 22.33566733,  7.70176861]), 0.0, True, {})\n",
      "(array([-6.7813278 , -1.91991749, 22.4897027 ,  7.29551755]), 0.0, True, {})\n",
      "(array([-6.81972615, -1.75835011, 22.63561305,  7.36779048]), 0.0, True, {})\n",
      "(array([-6.85489315, -1.60595748, 22.78296886,  7.37390293]), 0.0, True, {})\n",
      "(array([-6.8870123 , -1.83742343, 22.93044692,  6.92075775]), 0.0, True, {})\n",
      "(array([-6.92376077, -2.06619068, 23.06886207,  6.48087672]), 0.0, True, {})\n",
      "(array([-6.96508459, -2.29064472, 23.19847961,  6.06253278]), 0.0, True, {})\n",
      "(array([-7.01089748, -2.51002417, 23.31973027,  5.67075055]), 0.0, True, {})\n",
      "(array([-7.06109796, -2.35910641, 23.43314528,  5.43962981]), 0.0, True, {})\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(array([-7.10828009, -2.20549449, 23.54193787,  5.17766083]), 0.0, True, {})\n",
      "(array([-7.15238998, -2.41195179, 23.64549109,  4.87752418]), 0.0, True, {})\n",
      "(array([-7.20062902, -2.61430681, 23.74304157,  4.60987914]), 0.0, True, {})\n",
      "(array([-7.25291515, -2.44875808, 23.83523916,  4.27596191]), 0.0, True, {})\n",
      "(array([-7.30189032, -2.64407817, 23.92075839,  4.0719499 ]), 0.0, True, {})\n",
      "(array([-7.35477188, -2.47052024, 24.00219739,  3.70525272]), 0.0, True, {})\n",
      "(array([-7.40418228, -2.29263793, 24.07630245,  3.32557577]), 0.0, True, {})\n",
      "(array([-7.45003504, -2.48058704, 24.14281396,  3.2083163 ]), 0.0, True, {})\n",
      "(array([-7.49964678, -2.66794416, 24.20698029,  3.11675491]), 0.0, True, {})\n",
      "(array([-7.55300567, -2.4821842 , 24.26931539,  2.71430006]), 0.0, True, {})\n",
      "(array([-7.60264935, -2.29342117, 24.32360139,  2.3068406 ]), 0.0, True, {})\n",
      "(array([-7.64851777, -2.4780619 , 24.3697382 ,  2.28521134]), 0.0, True, {})\n",
      "(array([-7.69807901, -2.28600913, 24.41544243,  1.87381618]), 0.0, True, {})\n",
      "(array([-7.74379919, -2.47044701, 24.45291875,  1.88903903]), 0.0, True, {})\n",
      "(array([-7.79320813, -2.65539778, 24.49069953,  1.91996444]), 0.0, True, {})\n",
      "(array([-7.84631609, -2.46066112, 24.52909882,  1.50996836]), 0.0, True, {})\n",
      "(array([-7.89552931, -2.26471943, 24.55929819,  1.10111034]), 0.0, True, {})\n",
      "(array([-7.9408237 , -2.44995765, 24.58132039,  1.17501797]), 0.0, True, {})\n",
      "(array([-7.98982285, -2.63565606, 24.60482075,  1.25825352]), 0.0, True, {})\n",
      "(array([-8.04253598, -2.43872779, 24.62998582,  0.85497791]), 0.0, True, {})\n",
      "(array([-8.09131053, -2.62497417, 24.64708538,  0.95811629]), 0.0, True, {})\n",
      "(array([-8.14381001, -2.81161811, 24.66624771,  1.06847366]), 0.0, True, {})\n",
      "(array([-8.20004238, -2.99871084, 24.68761718,  1.18689807]), 0.0, True, {})\n",
      "(array([-8.26001659, -2.80128546, 24.71135514,  0.79302897]), 0.0, True, {})\n",
      "(array([-8.3160423 , -2.60348301, 24.72721572,  0.40202653]), 0.0, True, {})\n",
      "(array([-8.36811196e+00, -2.40547920e+00,  2.47352563e+01,  1.31259057e-02]), 0.0, True, {})\n",
      "(array([-8.41622155, -2.59342177, 24.73551877,  0.15925345]), 0.0, True, {})\n",
      "(array([-8.46808998, -2.39536214, 24.73870384, -0.22844074]), 0.0, True, {})\n",
      "(array([-8.51599723, -2.19731168, 24.73413502, -0.61562285]), 0.0, True, {})\n",
      "(array([-8.55994346, -2.3853741 , 24.72182257, -0.469756  ]), 0.0, True, {})\n",
      "(array([-8.60765094, -2.57313803, 24.71242745, -0.32899472]), 0.0, True, {})\n",
      "(array([-8.6591137 , -2.37512889, 24.70584755, -0.72012244]), 0.0, True, {})\n",
      "(array([-8.70661628, -2.17729294, 24.6914451 , -1.11197388]), 0.0, True, {})\n",
      "(array([-8.75016214, -1.97978401, 24.66920563, -1.50542575]), 0.0, True, {})\n",
      "(array([-8.78975782, -1.78279647, 24.63909711, -1.90117841]), 0.0, True, {})\n",
      "(array([-8.82541375, -1.97052107, 24.60107354, -1.792518  ]), 0.0, True, {})\n",
      "(array([-8.86482417, -1.77440941, 24.56522318, -2.19512907]), 0.0, True, {})\n",
      "(array([-8.90031236, -1.57943611, 24.5213206 , -2.59977933]), 0.0, True, {})\n",
      "(array([-8.93190108, -1.76707806, 24.46932501, -2.53807331]), 0.0, True, {})\n",
      "(array([-8.96724264, -1.9539271 , 24.41856355, -2.49829645]), 0.0, True, {})\n",
      "(array([-9.00632118, -1.76172891, 24.36859762, -2.90871204]), 0.0, True, {})\n",
      "(array([-9.04155576, -1.57180706, 24.31042338, -3.31781451]), 0.0, True, {})\n",
      "(array([-9.0729919 , -1.38475131, 24.24406709, -3.72417978]), 0.0, True, {})\n",
      "(array([-9.10068693, -1.2012067 , 24.16958349, -4.12596461]), 0.0, True, {})\n",
      "(array([-9.12471106, -1.02184403, 24.0870642 , -4.52094356]), 0.0, True, {})\n",
      "(array([-9.14514794, -1.21729185, 23.99664533, -4.62835946]), 0.0, True, {})\n",
      "(array([-9.16949378, -1.4140479 , 23.90407814, -4.77072398]), 0.0, True, {})\n",
      "(array([-9.19777474, -1.24620957, 23.80866366, -5.13214807]), 0.0, True, {})\n",
      "(array([-9.22269893, -1.4489066 , 23.7060207 , -5.34299041]), 0.0, True, {})\n",
      "(array([-9.25167706, -1.29065057, 23.59916089, -5.66802738]), 0.0, True, {})\n",
      "(array([-9.27749007, -1.50117746, 23.48580034, -5.95007407]), 0.0, True, {})\n",
      "(array([-9.30751362, -1.35240585, 23.36679886, -6.22624637]), 0.0, True, {})\n",
      "(array([-9.33456174, -1.20733093, 23.24227393, -6.47246889]), 0.0, True, {})\n",
      "(array([-9.35870836, -1.43079561, 23.11282456, -6.85691159]), 0.0, True, {})\n",
      "(array([-9.38732427, -1.29091035, 22.97568632, -7.03065377]), 0.0, True, {})\n",
      "(array([-9.41314248, -1.14973762, 22.83507325, -7.15840525]), 0.0, True, {})\n",
      "(array([-9.43613723, -1.00500826, 22.69190514, -7.23383216]), 0.0, True, {})\n",
      "(array([-9.45623739, -0.85445283, 22.5472285 , -7.25078564]), 0.0, True, {})\n",
      "(array([-9.47332645, -0.69606463, 22.40221279, -7.20419072]), 0.0, True, {})\n",
      "(array([-9.48724774, -0.5283877 , 22.25812897, -7.09110557]), 0.0, True, {})\n",
      "(array([-9.4978155 , -0.73902874, 22.11630686, -7.4734363 ]), 0.0, True, {})\n",
      "(array([-9.51259607, -0.94249704, 21.96683814, -7.81295198]), 0.0, True, {})\n",
      "(array([-9.53144601, -0.74558747, 21.8105791 , -7.51052833]), 0.0, True, {})\n",
      "(array([-9.54635776, -0.53853721, 21.66036853, -7.152203  ]), 0.0, True, {})\n",
      "(array([-9.55712851, -0.71170862, 21.51732447, -7.30239292]), 0.0, True, {})\n",
      "(array([-9.57136268, -0.87478494, 21.37127661, -7.38590823]), 0.0, True, {})\n",
      "(array([-9.58885838, -1.02841406, 21.22355845, -7.40268482]), 0.0, True, {})\n",
      "(array([-9.60942666, -1.1741045 , 21.07550475, -7.35578553]), 0.0, True, {})\n",
      "(array([-9.63290875, -0.94092353, 20.92838904, -6.90954795]), 0.0, True, {})\n",
      "(array([-9.65172722, -0.71180863, 20.79019808, -6.48549593]), 0.0, True, {})\n",
      "(array([-9.66596339, -0.8547439 , 20.66048816, -6.28887588]), 0.0, True, {})\n",
      "(array([-9.68305827, -0.9991089 , 20.53471064, -6.05481451]), 0.0, True, {})\n",
      "(array([-9.70304045, -1.14643263, 20.41361435, -5.78795137]), 0.0, True, {})\n",
      "(array([-9.7259691 , -1.29788712, 20.29785533, -5.49242733]), 0.0, True, {})\n",
      "(array([-9.75192684, -1.09025943, 20.18800678, -5.23868567]), 0.0, True, {})\n",
      "(array([-9.77373203, -1.25137595, 20.08323307, -4.89693757]), 0.0, True, {})\n",
      "(array([-9.79875955, -1.41803593, 19.98529432, -4.53679726]), 0.0, True, {})\n",
      "(array([-9.82712027, -1.590077  , 19.89455837, -4.16142125]), 0.0, True, {})\n",
      "(array([-9.85892181, -1.39712951, 19.81132995, -4.05239353]), 0.0, True, {})\n",
      "(array([-9.8868644 , -1.20505097, 19.73028207, -3.97607482]), 0.0, True, {})\n",
      "(array([-9.91096542, -1.01341483, 19.65076058, -3.93233247]), 0.0, True, {})\n",
      "(array([-9.93123372, -1.19790615, 19.57211393, -3.52861795]), 0.0, True, {})\n",
      "(array([-9.95519184, -1.00794387, 19.50154157, -3.54793487]), 0.0, True, {})\n",
      "(array([-9.97535072, -0.81741982, 19.43058287, -3.59671147]), 0.0, True, {})\n",
      "(array([-9.99169911, -1.00799338, 19.35864864, -3.19638948]), 0.0, True, {})\n",
      "(array([-10.01185898,  -0.81742899,  19.29472085,  -3.30269577]), 0.0, True, {})\n",
      "(array([-10.02820756,  -1.01091705,  19.22866694,  -2.91415142]), 0.0, True, {})\n",
      "(array([-10.0484259 ,  -0.81957727,  19.17038391,  -3.07197382]), 0.0, True, {})\n",
      "(array([-10.06481745,  -0.62724331,  19.10894443,  -3.25304029]), 0.0, True, {})\n",
      "(array([-10.07736231,  -0.8223335 ,  19.04388363,  -2.8947866 ]), 0.0, True, {})\n",
      "(array([-10.09380898,  -1.01805998,  18.9859879 ,  -2.54994947]), 0.0, True, {})\n",
      "(array([-10.11417018,  -0.82426998,  18.93498891,  -2.79794662]), 0.0, True, {})\n",
      "(array([-10.13065558,  -0.6298192 ,  18.87902997,  -3.06347224]), 0.0, True, {})\n",
      "(array([-10.14325197,  -0.82508138,  18.81776053,  -2.76204207]), 0.0, True, {})\n",
      "(array([-10.15975359,  -0.62975479,  18.76251969,  -3.06423014]), 0.0, True, {})\n",
      "(array([-10.17234869,  -0.82432352,  18.70123508,  -2.79903814]), 0.0, True, {})\n",
      "(array([-10.18883516,  -1.01816919,  18.64525432,  -2.55490872]), 0.0, True, {})\n",
      "(array([-10.20919854,  -1.2111528 ,  18.59415615,  -2.33110123]), 0.0, True, {})\n",
      "(array([-10.2334216 ,  -1.01478164,  18.54753412,  -2.69037714]), 0.0, True, {})\n",
      "(array([-10.25371723,  -0.81895514,  18.49372658,  -3.05827199]), 0.0, True, {})\n",
      "(array([-10.27009633,  -0.62405955,  18.43256114,  -3.43472252]), 0.0, True, {})\n",
      "(array([-10.28257753,  -0.43061028,  18.36386669,  -3.81910577]), 0.0, True, {})\n",
      "(array([-10.29118973,  -0.23926157,  18.28748457,  -4.2101801 ]), 0.0, True, {})\n",
      "(array([-10.29597496,  -0.43310404,  18.20328097,  -4.12083387]), 0.0, True, {})\n",
      "(array([-10.30463704,  -0.24602846,  18.1208643 ,  -4.52190841]), 0.0, True, {})\n",
      "(array([-10.30955761,  -0.44098428,  18.03042613,  -4.49951217]), 0.0, True, {})\n",
      "(array([-10.3183773 ,  -0.63577465,  17.94043588,  -4.51477342]), 0.0, True, {})\n",
      "(array([-10.33109279,  -0.45750902,  17.85014042,  -4.91102901]), 0.0, True, {})\n",
      "(array([-10.34024297,  -0.6556419 ,  17.75191983,  -4.99760497]), 0.0, True, {})\n",
      "(array([-10.35335581,  -0.48621497,  17.65196774,  -5.37511614]), 0.0, True, {})\n",
      "(array([-10.36308011,  -0.68979867,  17.54446541,  -5.53753657]), 0.0, True, {})\n",
      "(array([-10.37687608,  -0.89609911,  17.43371468,  -5.73996057]), 0.0, True, {})\n",
      "(array([-10.39479806,  -1.10581319,  17.31891547,  -5.98188844]), 0.0, True, {})\n",
      "(array([-10.41691433,  -0.95594625,  17.1992777 ,  -6.28467607]), 0.0, True, {})\n",
      "(array([-10.43603325,  -0.81091658,  17.07358418,  -6.56047525]), 0.0, True, {})\n",
      "(array([-10.45225158,  -0.66967067,  16.94237467,  -6.80514275]), 0.0, True, {})\n",
      "(array([-10.465645  ,  -0.53072458,  16.80627182,  -7.01387093]), 0.0, True, {})\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(array([-10.47625949,  -0.76103297,  16.6659944 ,  -7.43288098]), 0.0, True, {})\n",
      "(array([-10.49148015,  -0.62348749,  16.51733678,  -7.55473069]), 0.0, True, {})\n",
      "(array([-10.5039499 ,  -0.48128554,  16.36624217,  -7.62037529]), 0.0, True, {})\n",
      "(array([-10.51357561,  -0.71169649,  16.21383466,  -8.07363023]), 0.0, True, {})\n",
      "(array([-10.52780954,  -0.93979409,  16.05236206,  -8.51538722]), 0.0, True, {})\n",
      "(array([-10.54660542,  -0.77449381,  15.88205431,  -8.38126025]), 0.0, True, {})\n",
      "(array([-10.5620953 ,  -0.98347423,  15.71442911,  -8.7409172 ]), 0.0, True, {})\n",
      "(array([-10.58176478,  -0.78892756,  15.53961076,  -8.45100424]), 0.0, True, {})\n",
      "(array([-10.59754333,  -0.96963417,  15.37059068,  -8.66896979]), 0.0, True, {})\n",
      "(array([-10.61693602,  -0.74754425,  15.19721128,  -8.25729788]), 0.0, True, {})\n",
      "(array([-10.6318869 ,  -0.90134399,  15.03206533,  -8.31483794]), 0.0, True, {})\n",
      "(array([-10.64991378,  -0.66382759,  14.86576857,  -7.85296607]), 0.0, True, {})\n",
      "(array([-10.66319033,  -0.8013346 ,  14.70870925,  -7.77094466]), 0.0, True, {})\n",
      "(array([-10.67921703,  -0.56249889,  14.55329035,  -7.3298807 ]), 0.0, True, {})\n",
      "(array([-10.690467  ,  -0.32845782,  14.40669274,  -6.91906451]), 0.0, True, {})\n",
      "(array([-10.69703616,  -0.10015596,  14.26831145,  -6.54449231]), 0.0, True, {})\n",
      "(array([-10.69903928,   0.12225644,  14.1374216 ,  -6.20938998]), 0.0, True, {})\n",
      "(array([-10.69659415,   0.33912941,  14.0132338 ,  -5.91530715]), 0.0, True, {})\n",
      "(array([-10.68981156,   0.55109504,  13.89492766,  -5.66286565]), 0.0, True, {})\n",
      "(array([-10.67878966,   0.39384951,  13.78167035,  -5.32087008]), 0.0, True, {})\n",
      "(array([-10.67091267,   0.59711472,  13.67525294,  -5.1513743 ]), 0.0, True, {})\n",
      "(array([-10.65897038,   0.42928837,  13.57222546,  -4.77599434]), 0.0, True, {})\n",
      "(array([-10.65038461,   0.62643078,  13.47670557,  -4.68599121]), 0.0, True, {})\n",
      "(array([-10.63785599,   0.44935887,  13.38298575,  -4.29087124]), 0.0, True, {})\n",
      "(array([-10.62886882,   0.64289342,  13.29716832,  -4.27536187]), 0.0, True, {})\n",
      "(array([-10.61601095,   0.45855534,  13.21166109,  -3.87322863]), 0.0, True, {})\n",
      "(array([-10.60683984,   0.65050832,  13.13419651,  -3.92644214]), 0.0, True, {})\n",
      "(array([-10.59382967,   0.46098383,  13.05566767,  -3.52865458]), 0.0, True, {})\n",
      "(array([-10.58461   ,   0.6527657 ,  12.98509458,  -3.64439122]), 0.0, True, {})\n",
      "(array([-10.57155468,   0.45991765,  12.91220675,  -3.26057087]), 0.0, True, {})\n",
      "(array([-10.56235633,   0.2653737 ,  12.84699534,  -2.88637155]), 0.0, True, {})\n",
      "(array([-10.55704886,   0.069784  ,  12.78926791,  -2.52303838]), 0.0, True, {})\n",
      "(array([-10.55565318,   0.26249791,  12.73880714,  -2.73996744]), 0.0, True, {})\n",
      "(array([-10.55040322,   0.06663037,  12.68400779,  -2.40007783]), 0.0, True, {})\n",
      "(array([-10.54907061,   0.26054489,  12.63600623,  -2.6544337 ]), 0.0, True, {})\n",
      "(array([-10.54385971,   0.45508078,  12.58291756,  -2.92507399]), 0.0, True, {})\n",
      "(array([-10.5347581 ,   0.65009967,  12.52441608,  -3.21269771]), 0.0, True, {})\n",
      "(array([-10.5217561 ,   0.84537513,  12.46016212,  -3.51768415]), 0.0, True, {})\n",
      "(array([-10.5048486 ,   0.65064529,  12.38980844,  -3.25840192]), 0.0, True, {})\n",
      "(array([-10.4918357 ,   0.84598674,  12.3246404 ,  -3.59849874]), 0.0, True, {})\n",
      "(array([-10.47491596,   0.6519873 ,  12.25267043,  -3.38633888]), 0.0, True, {})\n",
      "(array([-10.46187622,   0.84651117,  12.18494365,  -3.75460765]), 0.0, True, {})\n",
      "(array([-10.44494599,   0.65318466,  12.1098515 ,  -3.59489828]), 0.0, True, {})\n",
      "(array([-10.4318823 ,   0.8456861 ,  12.03795353,  -3.98368298]), 0.0, True, {})\n",
      "(array([-10.41496858,   1.03571223,  11.95827987,  -4.37806968]), 0.0, True, {})\n",
      "(array([-10.39425433,   0.84127504,  11.87071848,  -4.30665867]), 0.0, True, {})\n",
      "(array([-10.37742883,   1.02629517,  11.78458531,  -4.70812136]), 0.0, True, {})\n",
      "(array([-10.35690293,   1.20679534,  11.69042288,  -5.10739809]), 0.0, True, {})\n",
      "(array([-10.33276702,   1.38186335,  11.58827492,  -5.50137035]), 0.0, True, {})\n",
      "(array([-10.30512975,   1.55064324,  11.47824751,  -5.88664572]), 0.0, True, {})\n",
      "(array([-10.27411689,   1.71242849,  11.3605146 ,  -6.25969698]), 0.0, True, {})\n",
      "(array([-10.23986832,   1.86676655,  11.23532066,  -6.61695901]), 0.0, True, {})\n",
      "(array([-10.20253299,   2.0135663 ,  11.10298148,  -6.95483787]), 0.0, True, {})\n",
      "(array([-10.16226166,   2.15319911,  10.96388472,  -7.26959678]), 0.0, True, {})\n",
      "(array([-10.11919768,   1.92292332,  10.81849278,  -7.57439335]), 0.0, True, {})\n",
      "(array([-10.08073921,   2.05135571,  10.66700492,  -7.82985929]), 0.0, True, {})\n",
      "(array([-10.0397121 ,   1.81099755,  10.51040773,  -8.22447325]), 0.0, True, {})\n",
      "(array([-10.00349215,   1.93474143,  10.34591826,  -8.39798185]), 0.0, True, {})\n",
      "(array([-9.96479732,  1.68930889, 10.17795863, -8.85478951]), 0.0, True, {})\n",
      "(array([-9.93101114,  1.44313776, 10.00086284, -9.32525357]), 0.0, True, {})\n",
      "(array([-9.90214839,  1.20051655,  9.81435777, -9.79060245]), 0.0, True, {})\n",
      "(array([-9.87813806,  1.35346732,  9.61854572, -9.69002862]), 0.0, True, {})\n",
      "(array([-9.85106871,  1.52776699,  9.42474514, -9.49008386]), 0.0, True, {})\n",
      "(array([-9.82051337,  1.3326484 ,  9.23494347, -9.78275211]), 0.0, True, {})\n",
      "(array([-9.7938604 ,  1.5474864 ,  9.03928842, -9.41080757]), 0.0, True, {})\n",
      "(array([-9.76291067,  1.77771215,  8.85107227, -8.98026404]), 0.0, True, {})\n",
      "(array([-9.72735643,  1.63490826,  8.67146699, -9.00060659]), 0.0, True, {})\n",
      "(array([-9.69465827,  1.88276433,  8.49145486, -8.52830393]), 0.0, True, {})\n",
      "(array([-9.65700298,  1.75744516,  8.32088878, -8.4039236 ]), 0.0, True, {})\n",
      "(array([-9.62185408,  1.63666305,  8.15281031, -8.22294284]), 0.0, True, {})\n",
      "(array([-9.58912082,  1.88243913,  7.98835145, -7.83343725]), 0.0, True, {})\n",
      "(array([-9.55147203,  1.7575237 ,  7.83168271, -7.56718898]), 0.0, True, {})\n",
      "(array([-9.51632156,  1.99109564,  7.68033893, -7.28107403]), 0.0, True, {})\n",
      "(array([-9.47649965,  2.21857248,  7.53471745, -7.05044746]), 0.0, True, {})\n",
      "(array([-9.4321282 ,  2.44080714,  7.3937085 , -6.8759328 ]), 0.0, True, {})\n",
      "(array([-9.38331205,  2.65874643,  7.25618984, -6.75773963]), 0.0, True, {})\n",
      "(array([-9.33013713,  2.50163393,  7.12103505, -6.38208622]), 0.0, True, {})\n",
      "(array([-9.28010445,  2.7107078 ,  6.99339333, -6.37340883]), 0.0, True, {})\n",
      "(array([-9.22589029,  2.91812649,  6.86592515, -6.41762876]), 0.0, True, {})\n",
      "(array([-9.16752776,  3.12420452,  6.73757257, -6.5139363 ]), 0.0, True, {})\n",
      "(array([-9.10504367,  2.94413429,  6.60729385, -6.14219843]), 0.0, True, {})\n",
      "(array([-9.04616098,  2.75778728,  6.48444988, -5.78360277]), 0.0, True, {})\n",
      "(array([-8.99100524,  2.95604424,  6.36877782, -6.01621226]), 0.0, True, {})\n",
      "(array([-8.93188435,  3.15285817,  6.24845358, -6.28521891]), 0.0, True, {})\n",
      "(array([-8.86882719,  3.34712237,  6.1227492 , -6.58664856]), 0.0, True, {})\n",
      "(array([-8.80188474,  3.53738916,  5.99101623, -6.91534967]), 0.0, True, {})\n",
      "(array([-8.73113696,  3.7219085 ,  5.85270924, -7.26508   ]), 0.0, True, {})\n",
      "(array([-8.65669879,  3.51339356,  5.70740764, -7.10352993]), 0.0, True, {})\n",
      "(array([-8.58643092,  3.68454768,  5.56533704, -7.47894736]), 0.0, True, {})\n",
      "(array([-8.51273997,  3.46750759,  5.41575809, -7.42711109]), 0.0, True, {})\n",
      "(array([-8.44338981,  3.24776819,  5.26721587, -7.43814715]), 0.0, True, {})\n",
      "(array([-8.37843445,  3.39561622,  5.11845293, -7.80487336]), 0.0, True, {})\n",
      "(array([-8.31052213,  3.16532253,  4.96235546, -7.93851829]), 0.0, True, {})\n",
      "(array([-8.24721567,  3.29537595,  4.80358509, -8.27163824]), 0.0, True, {})\n",
      "(array([-8.18130816,  3.05269098,  4.63815233, -8.53126464]), 0.0, True, {})\n",
      "(array([-8.12025434,  2.80380737,  4.46752704, -8.85214386]), 0.0, True, {})\n",
      "(array([-8.06417819,  2.91381148,  4.29048416, -9.09737288]), 0.0, True, {})\n",
      "(array([-8.00590196,  2.65540558,  4.1085367 , -9.52431763]), 0.0, True, {})\n",
      "(array([-7.95279385,  2.76551586,  3.91805035, -9.67254115]), 0.0, True, {})\n",
      "(array([-7.89748353,  2.88520527,  3.72459953, -9.75048394]), 0.0, True, {})\n",
      "(array([-7.83977943,  3.01968948,  3.52958985, -9.74393834]), 0.0, True, {})\n",
      "(array([-7.77938564,  3.17313706,  3.33471108, -9.64210648]), 0.0, True, {})\n",
      "(array([-7.71592289,  3.34767967,  3.14186895, -9.44158412]), 0.0, True, {})\n",
      "(array([-7.6489693 ,  3.54277363,  2.95303727, -9.14902442]), 0.0, True, {})\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(array([-7.57811383,  3.36605344,  2.77005678, -9.35429905]), 0.0, True, {})\n",
      "(array([-7.51079276,  3.20829713,  2.5829708 , -9.46805234]), 0.0, True, {})\n",
      "(array([-7.44662682,  3.45122551,  2.39360975, -9.0032271 ]), 0.0, True, {})\n",
      "(array([-7.37760231,  3.32143554,  2.21354521, -8.94597583]), 0.0, True, {})\n",
      "(array([-7.3111736 ,  3.2013236 ,  2.03462569, -8.8186355 ]), 0.0, True, {})\n",
      "(array([-7.24714712,  3.45518182,  1.85825298, -8.38534264]), 0.0, True, {})\n",
      "(array([-7.17804349,  3.33765179,  1.69054613, -8.15338817]), 0.0, True, {})\n",
      "(array([-7.11129045,  3.5812936 ,  1.52747837, -7.81783407]), 0.0, True, {})\n",
      "(array([-7.03966458,  3.81807407,  1.37112169, -7.53949032]), 0.0, True, {})\n",
      "(array([-6.9633031 ,  3.68394762,  1.22033188, -7.2114257 ]), 0.0, True, {})\n",
      "(array([-6.88962415,  3.90765766,  1.07610337, -7.05050788]), 0.0, True, {})\n",
      "(array([-6.81147099,  4.12703625,  0.93509321, -6.94798296]), 0.0, True, {})\n",
      "(array([-6.72893027,  4.34297312,  0.79613355, -6.90373121]), 0.0, True, {})\n",
      "(array([-6.64207081,  4.5561888 ,  0.65805892, -6.91733066]), 0.0, True, {})\n",
      "(array([-6.55094703,  4.38729974,  0.51971231, -6.53709279]), 0.0, True, {})\n",
      "(array([-6.46320103,  4.59322849,  0.38897046, -6.65919096]), 0.0, True, {})\n",
      "(array([-6.37133646,  4.41139451,  0.25578664, -6.29531911]), 0.0, True, {})\n",
      "(array([-6.28310857,  4.61184949,  0.12988025, -6.51183483]), 0.0, True, {})\n",
      "(array([-6.19087158e+00,  4.42047865e+00, -3.56442851e-04, -6.18911879e+00]), 0.0, True, {})\n",
      "(array([-6.10246201,  4.22534849, -0.12413882, -5.89652837]), 0.0, True, {})\n",
      "(array([-6.01795504,  4.41781652, -0.24206939, -6.2194119 ]), 0.0, True, {})\n",
      "(array([-5.92959871,  4.21782685, -0.36645762, -5.99864913]), 0.0, True, {})\n",
      "(array([-5.84524217,  4.40342388, -0.48643061, -6.36390319]), 0.0, True, {})\n",
      "(array([-5.7571737 ,  4.58312838, -0.61370867, -6.73963047]), 0.0, True, {})\n",
      "(array([-5.66551113,  4.37430529, -0.74850128, -6.65287115]), 0.0, True, {})\n",
      "(array([-5.57802502,  4.16407236, -0.8815587 , -6.62189079]), 0.0, True, {})\n",
      "(array([-5.49474358,  3.95220704, -1.01399652, -6.64667641]), 0.0, True, {})\n",
      "(array([-5.41569944,  3.73821391, -1.14693005, -6.72663381]), 0.0, True, {})\n",
      "(array([-5.34093516,  3.8892904 , -1.28146272, -7.0878203 ]), 0.0, True, {})\n",
      "(array([-5.26314935,  3.66611602, -1.42321913, -7.27408793]), 0.0, True, {})\n",
      "(array([-5.18982703,  3.80249963, -1.56870089, -7.59497342]), 0.0, True, {})\n",
      "(array([-5.11377704,  3.56826984, -1.72060036, -7.88823655]), 0.0, True, {})\n",
      "(array([-5.04241164,  3.32818095, -1.87836509, -8.23269172]), 0.0, True, {})\n",
      "(array([-4.97584802,  3.44816889, -2.04301892, -8.45840687]), 0.0, True, {})\n",
      "(array([-4.90688464,  3.19950688, -2.21218706, -8.88989348]), 0.0, True, {})\n",
      "(array([-4.8428945 ,  3.32029934, -2.38998493, -9.01705816]), 0.0, True, {})\n",
      "(array([-4.77648852,  3.0723191 , -2.57032609, -9.48956412]), 0.0, True, {})\n",
      "(array([-4.71504214,  2.82838886, -2.76011737, -9.95632665]), 0.0, True, {})\n",
      "(array([-4.65847436,  2.98100327, -2.95924391, -9.85331403]), 0.0, True, {})\n",
      "(array([-4.59885429,  3.15597018, -3.15631019, -9.64852888]), 0.0, True, {})\n",
      "(array([-4.53573489,  3.35263671, -3.34928077, -9.34923425]), 0.0, True, {})\n",
      "(array([-4.46868216,  3.56756745, -3.53626545, -8.97314406]), 0.0, True, {})\n",
      "(array([-4.39733081,  3.79551819, -3.71572833, -8.54445959]), 0.0, True, {})\n",
      "(array([-4.32142044,  4.03078656, -3.88661752, -8.08846659]), 0.0, True, {})\n",
      "(array([-4.24080471,  4.26834038, -4.04838686, -7.62720911]), 0.0, True, {})\n",
      "(array([-4.1554379 ,  4.13110352, -4.20093104, -7.52253784]), 0.0, True, {})\n",
      "(array([-4.07281583,  4.36734514, -4.35138179, -7.09271809]), 0.0, True, {})\n",
      "(array([-3.98546893,  4.23157343, -4.49323616, -6.88960412]), 0.0, True, {})\n",
      "(array([-3.90083746,  4.09426798, -4.63102824, -6.6474119 ]), 0.0, True, {})\n",
      "(array([-3.8189521 ,  4.31730719, -4.76397648, -6.32719451]), 0.0, True, {})\n",
      "(array([-3.73260596,  4.17111991, -4.89052037, -6.02227849]), 0.0, True, {})\n",
      "(array([-3.64918356,  4.01909489, -5.01096594, -5.69252444]), 0.0, True, {})\n",
      "(array([-3.56880166,  4.22653536, -5.12481642, -5.50306332]), 0.0, True, {})\n",
      "(array([-3.48427096,  4.06324313, -5.23487769, -5.13553535]), 0.0, True, {})\n",
      "(array([-3.40300609,  4.26345899, -5.3375884 , -5.03063394]), 0.0, True, {})\n",
      "(array([-3.31773691,  4.08990054, -5.43820108, -4.63988013]), 0.0, True, {})\n",
      "(array([-3.2359389 ,  3.91070385, -5.53099868, -4.24156886]), 0.0, True, {})\n",
      "(array([-3.15772483,  4.1040587 , -5.61583006, -4.25247776]), 0.0, True, {})\n",
      "(array([-3.07564365,  3.91809624, -5.70087961, -3.85141851]), 0.0, True, {})\n",
      "(array([-2.99728173,  3.7285406 , -5.77790798, -3.45225848]), 0.0, True, {})\n",
      "(array([-2.92271091,  3.91993497, -5.84695315, -3.56116441]), 0.0, True, {})\n",
      "(array([-2.84431222,  4.11227987, -5.91817644, -3.69843907]), 0.0, True, {})\n",
      "(array([-2.76206662,  3.91894197, -5.99214522, -3.32259217]), 0.0, True, {})\n",
      "(array([-2.68368778,  3.724142  , -6.05859707, -2.95831748]), 0.0, True, {})\n",
      "(array([-2.60920494,  3.91735058, -6.11776341, -3.17537669]), 0.0, True, {})\n",
      "(array([-2.53085793,  3.72190691, -6.18127095, -2.83780067]), 0.0, True, {})\n",
      "(array([-2.45641979,  3.91622951, -6.23802696, -3.09786115]), 0.0, True, {})\n",
      "(array([-2.3780952 ,  4.11109831, -6.29998418, -3.37659431]), 0.0, True, {})\n",
      "(array([-2.29587323,  3.91603441, -6.36751607, -3.08897838]), 0.0, True, {})\n",
      "(array([-2.21755254,  4.11147449, -6.42929564, -3.40586056]), 0.0, True, {})\n",
      "(array([-2.13532305,  4.30671173, -6.49741285, -3.73839975]), 0.0, True, {})\n",
      "(array([-2.04918882,  4.1123132 , -6.57218084, -3.51596987]), 0.0, True, {})\n",
      "(array([-1.96694256,  4.30676013, -6.64250024, -3.8793318 ]), 0.0, True, {})\n",
      "(array([-1.88080735,  4.11294977, -6.72008688, -3.71056207]), 0.0, True, {})\n",
      "(array([-1.79854836,  3.920168  , -6.79429812, -3.57295368]), 0.0, True, {})\n",
      "(array([-1.720145  ,  3.72842929, -6.86575719, -3.46591127]), 0.0, True, {})\n",
      "(array([-1.64557641,  3.91946125, -6.93507542, -3.86694423]), 0.0, True, {})\n",
      "(array([-1.56718719,  3.72757315, -7.0124143 , -3.81650224]), 0.0, True, {})\n",
      "(array([-1.49263572,  3.53632104, -7.08874435, -3.79847124]), 0.0, True, {})\n",
      "(array([-1.4219093 ,  3.3454754 , -7.16471377, -3.81220884]), 0.0, True, {})\n",
      "(array([-1.35499979,  3.15476095, -7.24095795, -3.85715844]), 0.0, True, {})\n",
      "(array([-1.29190458,  3.33589348, -7.31810112, -4.25394465]), 0.0, True, {})\n",
      "(array([-1.22518671,  3.51257438, -7.40318001, -4.642051  ]), 0.0, True, {})\n",
      "(array([-1.15493522,  3.31581775, -7.49602103, -4.77809333]), 0.0, True, {})\n",
      "(array([-1.08861886,  3.48398971, -7.5915829 , -5.14183996]), 0.0, True, {})\n",
      "(array([-1.01893907,  3.64668985, -7.6944197 , -5.48908261]), 0.0, True, {})\n",
      "(array([-0.94600527,  3.80383184, -7.80420135, -5.81679935]), 0.0, True, {})\n",
      "(array([-0.86992864,  3.59192091, -7.92053734, -6.09461821]), 0.0, True, {})\n",
      "(array([-0.79809022,  3.73920386, -8.0424297 , -6.37327436]), 0.0, True, {})\n",
      "(array([-0.72330614,  3.88263379, -8.16989519, -6.62176533]), 0.0, True, {})\n",
      "(array([-0.64565346,  4.02354394, -8.30233049, -6.83554814]), 0.0, True, {})\n",
      "(array([-0.56518259,  4.16365815, -8.43904146, -7.0093857 ]), 0.0, True, {})\n",
      "(array([-0.48190942,  4.3050271 , -8.57922917, -7.137381  ]), 0.0, True, {})\n",
      "(array([-0.39580888,  4.07501901, -8.72197679, -7.58624525]), 0.0, True, {})\n",
      "(array([-0.3143085 ,  4.22227504, -8.8737017 , -7.60773221]), 0.0, True, {})\n",
      "(array([-0.229863  ,  4.37830355, -9.02585634, -7.56227651]), 0.0, True, {})\n",
      "(array([-0.14229693,  4.15880017, -9.17710187, -7.97987551]), 0.0, True, {})\n",
      "(array([-0.05912093,  3.94597546, -9.33669938, -8.36144556]), 0.0, True, {})\n",
      "(array([ 0.01979858,  3.74371142, -9.50392829, -8.68952715]), 0.0, True, {})\n",
      "(array([ 0.09467281,  3.55563052, -9.67771883, -8.94751934]), 0.0, True, {})\n",
      "(array([ 0.16578542,  3.77277828, -9.85666922, -8.55858778]), 0.0, True, {})\n",
      "(array([  0.24124099,   4.00034813, -10.02784098,  -8.12551245]), 0.0, True, {})\n",
      "(array([  0.32124795,   4.23322135, -10.19035123,  -7.67107275]), 0.0, True, {})\n",
      "(array([  0.40591238,   4.46707429, -10.34377268,  -7.21443854]), 0.0, True, {})\n",
      "(array([  0.49525386,   4.6987666 , -10.48806145,  -6.76988718]), 0.0, True, {})\n",
      "(array([  0.5892292 ,   4.55675074, -10.6234592 ,  -6.61647476]), 0.0, True, {})\n",
      "(array([  0.68036421,   4.78220147, -10.75578869,  -6.21963971]), 0.0, True, {})\n",
      "(array([  0.77600824,   4.63706917, -10.88018148,  -5.98575352]), 0.0, True, {})\n",
      "(array([  0.86874962,   4.48900099, -10.99989656,  -5.71928089]), 0.0, True, {})\n",
      "(array([  0.95852964,   4.3368611 , -11.11428217,  -5.42429726]), 0.0, True, {})\n",
      "(array([  1.04526687,   4.54386567, -11.22276812,  -5.16913939]), 0.0, True, {})\n",
      "(array([  1.13614418,   4.74712091, -11.32615091,  -4.95136766]), 0.0, True, {})\n",
      "(array([  1.2310866 ,   4.58108779, -11.42517826,  -4.59244753]), 0.0, True, {})\n",
      "(array([  1.32270835,   4.40961203, -11.51702721,  -4.21803082]), 0.0, True, {})\n",
      "(array([  1.41090059,   4.23305925, -11.60138783,  -3.83118237]), 0.0, True, {})\n",
      "(array([  1.49556178,   4.05195062, -11.67801147,  -3.43480956]), 0.0, True, {})\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(array([  1.57660079,   3.86689635, -11.74670766,  -3.03158764]), 0.0, True, {})\n",
      "(array([  1.65393872,   3.67853723, -11.80733942,  -2.62387488]), 0.0, True, {})\n",
      "(array([  1.72750946,   3.86467024, -11.85981692,  -2.62409864]), 0.0, True, {})\n",
      "(array([  1.80480287,   3.67274686, -11.91229889,  -2.21426256]), 0.0, True, {})\n",
      "(array([  1.8782578 ,   3.47886203, -11.95658414,  -1.80458195]), 0.0, True, {})\n",
      "(array([  1.94783504,   3.2835146 , -11.99267578,  -1.39600034]), 0.0, True, {})\n",
      "(array([  2.01350534,   3.08712004, -12.02059578,  -0.98900696]), 0.0, True, {})\n",
      "(array([  2.07524774,   2.89001652, -12.04037592,  -0.58369324]), 0.0, True, {})\n",
      "(array([  2.13304807,   3.07565418, -12.05204979,  -0.67689975]), 0.0, True, {})\n",
      "(array([  2.19456115,   2.87810783, -12.06558778,  -0.27428453]), 0.0, True, {})\n",
      "(array([  2.25212331,   3.06408818, -12.07107347,  -0.37784638]), 0.0, True, {})\n",
      "(array([  2.31340507,   2.86630445, -12.0786304 ,   0.02291315]), 0.0, True, {})\n",
      "(array([  2.37073116,   2.66842537, -12.07817214,   0.42289843]), 0.0, True, {})\n",
      "(array([  2.42409967,   2.85468998, -12.06971417,   0.31403732]), 0.0, True, {})\n",
      "(array([  2.48119347,   2.65689193, -12.06343342,   0.7149753 ]), 0.0, True, {})\n",
      "(array([  2.53433131,   2.84303336, -12.04913392,   0.61204615]), 0.0, True, {})\n",
      "(array([  2.59119197,   3.0288477 , -12.036893  ,   0.51516168]), 0.0, True, {})\n",
      "(array([  2.65176893,   3.21438534, -12.02658976,   0.42345772]), 0.0, True, {})\n",
      "(array([  2.71605663,   3.39969287, -12.01812061,   0.3361173 ]), 0.0, True, {})\n",
      "(array([  2.78405049,   3.58481355, -12.01139826,   0.25236498]), 0.0, True, {})\n",
      "(array([  2.85574676,   3.76978777, -12.00635096,   0.17146085]), 0.0, True, {})\n",
      "(array([  2.93114252,   3.57230401, -12.00292174,   0.57861008]), 0.0, True, {})\n",
      "(array([  3.0025886 ,   3.75726392, -11.99134954,   0.50108431]), 0.0, True, {})\n",
      "(array([  3.07773388,   3.55999911, -11.98132786,   0.90928821]), 0.0, True, {})\n",
      "(array([  3.14893386,   3.3631133 , -11.96314209,   1.31785744]), 0.0, True, {})\n",
      "(array([  3.21619612,   3.5481393 , -11.93678494,   1.25608918]), 0.0, True, {})\n",
      "(array([  3.28715891,   3.73266126, -11.91166316,   1.20548352]), 0.0, True, {})\n",
      "(array([  3.36181214,   3.91672548, -11.88755349,   1.16550131]), 0.0, True, {})\n",
      "(array([  3.44014665,   3.72107097, -11.86424346,   1.57851746]), 0.0, True, {})\n",
      "(array([  3.51456806,   3.90507551, -11.83267311,   1.5576724 ]), 0.0, True, {})\n",
      "(array([  3.59266957,   4.08862793, -11.80151967,   1.55005322]), 0.0, True, {})\n",
      "(array([  3.67444213,   3.89476555, -11.7705186 ,   1.96343086]), 0.0, True, {})\n",
      "(array([  3.75233744,   4.07854137, -11.73124998,   1.98060672]), 0.0, True, {})\n",
      "(array([  3.83390827,   3.88683157, -11.69163785,   2.39155299]), 0.0, True, {})\n",
      "(array([  3.9116449 ,   4.07123351, -11.64380679,   2.43980208]), 0.0, True, {})\n",
      "(array([  3.99306957,   3.88260877, -11.59501075,   2.84499615]), 0.0, True, {})\n",
      "(array([  4.07072175,   4.06830731, -11.53811083,   2.93058798]), 0.0, True, {})\n",
      "(array([  4.1520879 ,   3.88391513, -11.47949907,   3.32517539]), 0.0, True, {})\n",
      "(array([  4.2297662 ,   4.07190165, -11.41299556,   3.45422402]), 0.0, True, {})\n",
      "(array([  4.31120423,   4.26079971, -11.34391108,   3.60811023]), 0.0, True, {})\n",
      "(array([  4.39642023,   4.08441703, -11.27174887,   3.97476146]), 0.0, True, {})\n",
      "(array([  4.47810857,   4.27752653, -11.19225364,   4.17863566]), 0.0, True, {})\n",
      "(array([  4.5636591 ,   4.4728598 , -11.10868093,   4.40971138]), 0.0, True, {})\n",
      "(array([  4.65311629,   4.30696369, -11.0204867 ,   4.72991875]), 0.0, True, {})\n",
      "(array([  4.73925557,   4.14513787, -10.92588833,   5.02987411]), 0.0, True, {})\n",
      "(array([  4.82215832,   4.35089616, -10.82529085,   5.34465084]), 0.0, True, {})\n",
      "(array([  4.90917625,   4.1966006 , -10.71839783,   5.59517787]), 0.0, True, {})\n",
      "(array([  4.99310826,   4.41040134, -10.60649427,   5.96571341]), 0.0, True, {})\n",
      "(array([  5.08131629,   4.62899066, -10.48718   ,   6.36211803]), 0.0, True, {})\n",
      "(array([  5.1738961 ,   4.48263341, -10.35993764,   6.51207042]), 0.0, True, {})\n",
      "(array([  5.26354877,   4.33466607, -10.22969624,   6.61688035]), 0.0, True, {})\n",
      "(array([  5.35024209,   4.55920582, -10.09735863,   7.06225427]), 0.0, True, {})\n",
      "(array([ 5.4414262 ,  4.405746  , -9.95611354,  7.06536004]), 0.0, True, {})\n",
      "(array([ 5.52954112,  4.62764087, -9.81480634,  7.5012792 ]), 0.0, True, {})\n",
      "(array([ 5.62209394,  4.46020588, -9.66478076,  7.38077182]), 0.0, True, {})\n",
      "(array([ 5.71129806,  4.67040347, -9.51716532,  7.75691633]), 0.0, True, {})\n",
      "(array([ 5.80470613,  4.87213286, -9.36202699,  8.08534322]), 0.0, True, {})\n",
      "(array([ 5.90214879,  5.06230299, -9.20032013,  8.35160029]), 0.0, True, {})\n",
      "(array([ 6.00339485,  5.23852813, -9.03328812,  8.5438692 ]), 0.0, True, {})\n",
      "(array([ 6.10816541,  5.39970081, -8.86241074,  8.65515673]), 0.0, True, {})\n",
      "(array([ 6.21615943,  5.54633538, -8.68930761,  8.684477  ]), 0.0, True, {})\n",
      "(array([ 6.32708613,  5.68053417, -8.51561807,  8.63648748]), 0.0, True, {})\n",
      "(array([ 6.44069682,  5.43235016, -8.34288832,  8.1757954 ]), 0.0, True, {})\n",
      "(array([ 6.54934382,  5.18766299, -8.17937241,  7.74385841]), 0.0, True, {})\n",
      "(array([ 6.65309708,  4.94847519, -8.02449524,  7.3505908 ]), 0.0, True, {})\n",
      "(array([ 6.75206658,  5.07990972, -7.87748342,  7.09430886]), 0.0, True, {})\n",
      "(array([ 6.85366478,  4.8520278 , -7.73559725,  6.79235734]), 0.0, True, {})\n",
      "(array([ 6.95070533,  4.62991731, -7.5997501 ,  6.53976467]), 0.0, True, {})\n",
      "(array([ 7.04330368,  4.41278491, -7.46895481,  6.33712852]), 0.0, True, {})\n",
      "(array([ 7.13155938,  4.1997338 , -7.34221224,  6.18468062]), 0.0, True, {})\n",
      "(array([ 7.21555405,  4.35955345, -7.21851862,  5.8109476 ]), 0.0, True, {})\n",
      "(array([ 7.30274512,  4.52707406, -7.10229967,  5.42518946]), 0.0, True, {})\n",
      "(array([ 7.3932866 ,  4.32598194, -6.99379588,  5.4163895 ]), 0.0, True, {})\n",
      "(array([ 7.47980624,  4.50398291, -6.88546809,  5.02223686]), 0.0, True, {})\n",
      "(array([ 7.5698859 ,  4.68754831, -6.78502336,  4.6287794 ]), 0.0, True, {})\n",
      "(array([ 7.66363687,  4.87548129, -6.69244777,  4.24021306]), 0.0, True, {})\n",
      "(array([ 7.76114649,  5.06664385, -6.60764351,  3.86015785]), 0.0, True, {})\n",
      "(array([ 7.86247937,  5.26002672, -6.53044035,  3.49149275]), 0.0, True, {})\n",
      "(array([ 7.9676799 ,  5.06624654, -6.46061049,  3.70136857]), 0.0, True, {})\n",
      "(array([ 8.06900483,  5.26105688, -6.38658312,  3.36185066]), 0.0, True, {})\n",
      "(array([ 8.17422597,  5.06642091, -6.31934611,  3.62190054]), 0.0, True, {})\n",
      "(array([ 8.27555439,  5.26157965, -6.2469081 ,  3.31872484]), 0.0, True, {})\n",
      "(array([ 8.38078598,  5.0663464 , -6.1805336 ,  3.6220452 ]), 0.0, True, {})\n",
      "(array([ 8.48211291,  4.87122407, -6.1080927 ,  3.94331462]), 0.0, True, {})\n",
      "(array([ 8.57953739,  5.06609594, -6.02922641,  3.70669069]), 0.0, True, {})\n",
      "(array([ 8.68085931,  4.87175173, -5.95509259,  4.06272064]), 0.0, True, {})\n",
      "(array([ 8.77829435,  5.0662104 , -5.87383818,  3.88132966]), 0.0, True, {})\n",
      "(array([ 8.87961855,  4.87393041, -5.79621159,  4.26293572]), 0.0, True, {})\n",
      "(array([ 8.97709716,  4.68421382, -5.71095287,  4.65200799]), 0.0, True, {})\n",
      "(array([ 9.07078144,  4.88003836, -5.61791271,  4.56426916]), 0.0, True, {})\n",
      "(array([ 9.16838221,  4.69563844, -5.52662733,  4.96336215]), 0.0, True, {})\n",
      "(array([ 9.26229497,  4.89328502, -5.42736009,  4.94957658]), 0.0, True, {})\n",
      "(array([ 9.36016067,  4.7164874 , -5.32836855,  5.34544117]), 0.0, True, {})\n",
      "(array([ 9.45449042,  4.91778707, -5.22145973,  5.41095245]), 0.0, True, {})\n",
      "(array([ 9.55284616,  4.7508194 , -5.11324068,  5.78973415]), 0.0, True, {})\n",
      "(array([ 9.64786255,  4.5905947 , -4.997446  ,  6.15420863]), 0.0, True, {})\n",
      "(array([ 9.73967445,  4.80299346, -4.87436183,  6.34675077]), 0.0, True, {})\n",
      "(array([ 9.83573432,  5.01920815, -4.74742681,  6.58460065]), 0.0, True, {})\n",
      "(array([ 9.93611848,  4.87630139, -4.6157348 ,  6.88592938]), 0.0, True, {})\n",
      "(array([10.03364451,  5.10245108, -4.47801621,  7.21129362]), 0.0, True, {})\n",
      "(array([10.13569353,  4.96914407, -4.33379034,  7.45081829]), 0.0, True, {})\n",
      "(array([10.23507641,  4.83758402, -4.18477397,  7.65105766]), 0.0, True, {})\n",
      "(array([10.33182809,  4.70527237, -4.03175282,  7.80515346]), 0.0, True, {})\n",
      "(array([10.42593354,  4.94308886, -3.87564975,  8.25812462]), 0.0, True, {})\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(array([10.52479531,  5.18206668, -3.71048726,  8.72121969]), 0.0, True, {})\n",
      "(array([10.62843665,  5.41864805, -3.53606286,  9.17857645]), 0.0, True, {})\n",
      "(array([10.73680961,  5.26189634, -3.35249133,  9.07449644]), 0.0, True, {})\n",
      "(array([10.84204754,  5.08708849, -3.17100141,  8.87964003]), 0.0, True, {})\n",
      "(array([10.94378931,  4.89466217, -2.9934086 ,  8.59977029]), 0.0, True, {})\n",
      "(array([11.04168255,  5.07674677, -2.8214132 ,  8.8264971 ]), 0.0, True, {})\n",
      "(array([11.14321748,  4.85502535, -2.64488326,  8.41828449]), 0.0, True, {})\n",
      "(array([11.24031799,  5.00863933, -2.47651757,  8.48075899]), 0.0, True, {})\n",
      "(array([11.34049078,  5.14956748, -2.30690239,  8.46566453]), 0.0, True, {})\n",
      "(array([11.44348213,  5.28047625, -2.1375891 ,  8.37962413]), 0.0, True, {})\n",
      "(array([11.54909165,  5.40483288, -1.96999661,  8.23175372]), 0.0, True, {})\n",
      "(array([11.65718831,  5.52635904, -1.80536154,  8.0317228 ]), 0.0, True, {})\n",
      "(array([11.76771549,  5.28358756, -1.64472708,  7.66113638]), 0.0, True, {})\n",
      "(array([11.87338724,  5.04748564, -1.49150436,  7.34178054]), 0.0, True, {})\n",
      "(array([11.97433695,  4.81777676, -1.34466875,  7.07599676]), 0.0, True, {})\n",
      "(array([12.07069249,  4.59375155, -1.20314881,  6.86482292]), 0.0, True, {})\n",
      "(array([12.16256752,  4.74137342, -1.06585235,  6.5108817 ]), 0.0, True, {})\n",
      "(array([12.25739499,  4.89761423, -0.93563472,  6.14019823]), 0.0, True, {})\n",
      "(array([12.35534727,  5.06217425, -0.81283075,  5.75708327]), 0.0, True, {})\n",
      "(array([12.45659076,  4.85858576, -0.69768909,  5.75350382]), 0.0, True, {})\n",
      "(array([12.55376247,  4.65589763, -0.58261901,  5.79761261]), 0.0, True, {})\n",
      "(array([12.64688043,  4.83558548, -0.46666676,  5.41078443]), 0.0, True, {})\n",
      "(array([12.74359214,  4.63632664, -0.35845107,  5.54543932]), 0.0, True, {})\n",
      "(array([12.83631867,  4.43718427, -0.24754228,  5.72202473]), 0.0, True, {})\n",
      "(array([12.92506235,  4.23851517, -0.13310179,  5.93890806]), 0.0, True, {})\n",
      "(array([13.00983266,  4.43070929, -0.01432363,  5.61415032]), 0.0, True, {})\n",
      "(array([13.09844684,  4.23535523,  0.09795938,  5.90294035]), 0.0, True, {})\n",
      "(array([13.18315395,  4.43226824,  0.21601818,  5.63774091]), 0.0, True, {})\n",
      "(array([13.27179931,  4.24143179,  0.328773  ,  5.98035921]), 0.0, True, {})\n",
      "(array([13.35662795,  4.441908  ,  0.44838019,  5.79067869]), 0.0, True, {})\n",
      "(array([13.44546611,  4.25789559,  0.56419376,  6.16686389]), 0.0, True, {})\n",
      "(array([13.53062402,  4.07985834,  0.68753104,  6.54974344]), 0.0, True, {})\n",
      "(array([13.61222119,  4.28836295,  0.81852591,  6.49462166]), 0.0, True, {})\n",
      "(array([13.69798845,  4.49819122,  0.94841834,  6.49421971]), 0.0, True, {})\n",
      "(array([13.78795227,  4.70973309,  1.07830273,  6.54810958]), 0.0, True, {})\n",
      "(array([13.88214693,  4.55432559,  1.20926493,  6.91739035]), 0.0, True, {})\n",
      "(array([13.97323344,  4.77428706,  1.34761273,  7.0756822 ]), 0.0, True, {})\n",
      "(array([14.06871919,  4.63349918,  1.48912638,  7.40913234]), 0.0, True, {})\n",
      "(array([14.16138917,  4.86407385,  1.63730902,  7.67393726]), 0.0, True, {})\n",
      "(array([14.25867065,  4.73652085,  1.79078777,  7.95457072]), 0.0, True, {})\n",
      "(array([14.35340106,  4.61328505,  1.94987918,  8.20114611]), 0.0, True, {})\n",
      "(array([14.44566676,  4.49172958,  2.11390211,  8.40679762]), 0.0, True, {})\n",
      "(array([14.53550136,  4.73896681,  2.28203806,  8.85015062]), 0.0, True, {})\n",
      "(array([14.63028069,  4.61406967,  2.45904107,  8.95057629]), 0.0, True, {})\n",
      "(array([14.72256208,  4.85839869,  2.6380526 ,  9.42041058]), 0.0, True, {})\n",
      "(array([14.81973006,  4.71358238,  2.82646081,  9.37201163]), 0.0, True, {})\n",
      "(array([14.91400171,  4.55039325,  3.01390104,  9.23040508]), 0.0, True, {})\n",
      "(array([15.00500957,  4.36788451,  3.19850914,  8.99631021]), 0.0, True, {})\n",
      "(array([15.09236726,  4.16750382,  3.37843535,  8.67950148]), 0.0, True, {})\n",
      "(array([15.17571734,  4.34140938,  3.55202538,  8.86409501]), 0.0, True, {})\n",
      "(array([15.26254553,  4.11311368,  3.72930728,  8.43278419]), 0.0, True, {})\n",
      "(array([15.3448078 ,  3.87819162,  3.89796296,  7.97651606]), 0.0, True, {})\n",
      "(array([15.42237163,  4.0187124 ,  4.05749328,  7.92805583]), 0.0, True, {})\n",
      "(array([15.50274588,  3.77905853,  4.2160544 ,  7.47592974]), 0.0, True, {})\n",
      "(array([15.57832705,  3.91266884,  4.36557299,  7.31284453]), 0.0, True, {})\n",
      "(array([15.65658043,  4.04554032,  4.51182988,  7.10409491]), 0.0, True, {})\n",
      "(array([15.73749123,  3.81553034,  4.65391178,  6.7472551 ]), 0.0, True, {})\n",
      "(array([15.81380184,  3.59156428,  4.78885688,  6.43412347]), 0.0, True, {})\n",
      "(array([15.88563313,  3.73693369,  4.91753935,  6.12432471]), 0.0, True, {})\n",
      "(array([15.9603718 ,  3.88846333,  5.04002585,  5.79018664]), 0.0, True, {})\n",
      "(array([16.03814107,  4.04661279,  5.15582958,  5.43548554]), 0.0, True, {})\n",
      "(array([16.11907332,  4.21141768,  5.26453929,  5.06385671]), 0.0, True, {})\n",
      "(array([16.20330168,  4.38256681,  5.36581643,  4.67888902]), 0.0, True, {})\n",
      "(array([16.29095301,  4.55949124,  5.45939421,  4.28412002]), 0.0, True, {})\n",
      "(array([16.38214284,  4.7414567 ,  5.54507661,  3.88295117]), 0.0, True, {})\n",
      "(array([16.47697197,  4.92765074,  5.62273563,  3.47851802]), 0.0, True, {})\n",
      "(array([16.57552499,  4.73747185,  5.69230599,  3.52343834]), 0.0, True, {})\n",
      "(array([16.67027442,  4.92815124,  5.76277476,  3.12212857]), 0.0, True, {})\n",
      "(array([16.76883745,  4.73792896,  5.82521733,  3.22350066]), 0.0, True, {})\n",
      "(array([16.86359603,  4.54674679,  5.88968734,  3.35073756]), 0.0, True, {})\n",
      "(array([16.95453096,  4.74066153,  5.95670209,  2.9693699 ]), 0.0, True, {})\n",
      "(array([17.04934419,  4.93591172,  6.01608949,  2.59767551]), 0.0, True, {})\n",
      "(array([17.14806243,  4.74368297,  6.068043  ,  2.7981986 ]), 0.0, True, {})\n",
      "(array([17.24293609,  4.55056535,  6.12400697,  3.01843181]), 0.0, True, {})\n",
      "(array([17.33394739,  4.74616328,  6.18437561,  2.68214303]), 0.0, True, {})\n",
      "(array([17.42887066,  4.94186139,  6.23801847,  2.3610249 ]), 0.0, True, {})\n",
      "(array([17.52770789,  5.1373555 ,  6.28523897,  2.05480826]), 0.0, True, {})\n",
      "(array([17.630455  ,  5.3324564 ,  6.32633513,  1.7627613 ]), 0.0, True, {})\n",
      "(array([17.73710412,  5.13687379,  6.36159036,  2.06854427]), 0.0, True, {})\n",
      "(array([17.8398416 ,  4.94104687,  6.40296124,  2.38440972]), 0.0, True, {})\n",
      "(array([17.93866254,  4.74509103,  6.45064944,  2.71136755]), 0.0, True, {})\n",
      "(array([18.03356436,  4.54920575,  6.50487679,  3.05008966]), 0.0, True, {})\n",
      "(array([18.12454847,  4.35369487,  6.56587858,  3.40082357]), 0.0, True, {})\n",
      "(array([18.21162237,  4.15898725,  6.63389505,  3.76330165]), 0.0, True, {})\n",
      "(array([18.29480212,  3.96565482,  6.70916109,  4.13665576]), 0.0, True, {})\n",
      "(array([18.37411521,  4.15985249,  6.7918942 ,  3.9928743 ]), 0.0, True, {})\n",
      "(array([18.45731226,  4.35309539,  6.87175169,  3.882907  ]), 0.0, True, {})\n",
      "(array([18.54437417,  4.5454238 ,  6.94940983,  3.80617665]), 0.0, True, {})\n",
      "(array([18.63528265,  4.73695966,  7.02553336,  3.76200827]), 0.0, True, {})\n",
      "(array([18.73002184,  4.55027044,  7.10077353,  4.16711039]), 0.0, True, {})\n",
      "(array([18.82102725,  4.36746936,  7.18411573,  4.56913204]), 0.0, True, {})\n",
      "(array([18.90837664,  4.56279495,  7.27549838,  4.61768921]), 0.0, True, {})\n",
      "(array([18.99963253,  4.38751699,  7.36785216,  5.00760437]), 0.0, True, {})\n",
      "(array([19.08738287,  4.21780823,  7.46800425,  5.38647758]), 0.0, True, {})\n",
      "(array([19.17173904,  4.05418411,  7.5757338 ,  5.75124635]), 0.0, True, {})\n",
      "(array([19.25282272,  3.89694096,  7.69075873,  6.09872385]), 0.0, True, {})\n",
      "(array([19.33076154,  4.11036437,  7.8127332 ,  6.33679453]), 0.0, True, {})\n",
      "(array([19.41296883,  4.32813066,  7.93946909,  6.6170745 ]), 0.0, True, {})\n",
      "(array([19.49953144,  4.55085622,  8.07181058,  6.93852645]), 0.0, True, {})\n",
      "(array([19.59054857,  4.77895276,  8.21058111,  7.29951996]), 0.0, True, {})\n",
      "(array([19.68612762,  4.64579153,  8.35657151,  7.50529641]), 0.0, True, {})\n",
      "(array([19.77904345,  4.88186165,  8.50667744,  7.93351109]), 0.0, True, {})\n",
      "(array([19.87668068,  4.74859727,  8.66534766,  8.04567599]), 0.0, True, {})\n",
      "(array([19.97165263,  4.98612351,  8.82626118,  8.50648861]), 0.0, True, {})\n",
      "(array([20.0713751 ,  4.84082681,  8.99639095,  8.49207326]), 0.0, True, {})\n",
      "(array([20.16819164,  5.0677293 ,  9.16623242,  8.92380042]), 0.0, True, {})\n",
      "(array([20.26954622,  4.8968335 ,  9.34470843,  8.75114522]), 0.0, True, {})\n",
      "(array([20.36748289,  4.70891891,  9.51973133,  8.4936917 ]), 0.0, True, {})\n",
      "(array([20.46166127,  4.5059038 ,  9.68960516,  8.16266646]), 0.0, True, {})\n",
      "(array([20.55177935,  4.29122081,  9.85285849,  7.77491617]), 0.0, True, {})\n",
      "(array([20.63760376,  4.06900262, 10.00835682,  7.34962009]), 0.0, True, {})\n",
      "(array([20.71898382,  3.84326307, 10.15534922,  6.90505384]), 0.0, True, {})\n",
      "(array([20.79584908,  3.61733412, 10.2934503 ,  6.45646349]), 0.0, True, {})\n",
      "(array([20.86819576,  3.39363187, 10.42257957,  6.01528864]), 0.0, True, {})\n",
      "(array([20.9360684 ,  3.17367733, 10.54288534,  5.58937315]), 0.0, True, {})\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(array([20.99954194,  3.32669481, 10.6546728 ,  5.4253779 ]), 0.0, True, {})\n",
      "(array([21.06607584,  3.48025353, 10.76318036,  5.22530703]), 0.0, True, {})\n",
      "(array([21.13568091,  3.63548367, 10.8676865 ,  4.99283644]), 0.0, True, {})\n",
      "(array([21.20839058,  3.7933093 , 10.96754323,  4.73143089]), 0.0, True, {})\n",
      "(array([21.28425677,  3.95441839, 11.06217185,  4.44431959]), 0.0, True, {})\n",
      "(array([21.36334514,  3.75551097, 11.15105824,  4.17082676]), 0.0, True, {})\n",
      "(array([21.43845536,  3.9240256 , 11.23447477,  3.84122955]), 0.0, True, {})\n",
      "(array([21.51693587,  4.09654221, 11.31129936,  3.49434446]), 0.0, True, {})\n",
      "(array([21.59886671,  3.90686984, 11.38118625,  3.30321799]), 0.0, True, {})\n",
      "(array([21.67700411,  4.08588111, 11.44725061,  2.92981062]), 0.0, True, {})\n",
      "(array([21.75872173,  4.26829579, 11.50584683,  2.54586492]), 0.0, True, {})\n",
      "(array([21.84408765,  4.08403458, 11.55676412,  2.42431109]), 0.0, True, {})\n",
      "(array([21.92576834,  4.27096024, 11.60525035,  2.02618303]), 0.0, True, {})\n",
      "(array([22.01118754,  4.460223  , 11.64577401,  1.62259364]), 0.0, True, {})\n",
      "(array([22.100392  ,  4.27839584, 11.67822588,  1.55368289]), 0.0, True, {})\n",
      "(array([22.18595992,  4.09647996, 11.70929954,  1.49771066]), 0.0, True, {})\n",
      "(array([22.26788952,  3.91441343, 11.73925375,  1.45425368]), 0.0, True, {})\n",
      "(array([22.34617779,  3.73214292, 11.76833882,  1.42297066]), 0.0, True, {})\n",
      "(array([22.42082065,  3.92575653, 11.79679824,  1.00972402]), 0.0, True, {})\n",
      "(array([22.49933578,  4.12045578, 11.81699272,  0.59539862]), 0.0, True, {})\n",
      "(array([22.58174489,  4.31585991, 11.82890069,  0.18054389]), 0.0, True, {})\n",
      "(array([22.66806209,  4.13387513, 11.83251157,  0.18490329]), 0.0, True, {})\n",
      "(array([22.75073959,  4.3296809 , 11.83620963, -0.23010705]), 0.0, True, {})\n",
      "(array([22.83733321,  4.14757925, 11.83160749, -0.22268508]), 0.0, True, {})\n",
      "(array([22.9202848 ,  4.34336405, 11.82715379, -0.63769146]), 0.0, True, {})\n",
      "(array([23.00715208,  4.16116597, 11.81439996, -0.63379642]), 0.0, True, {})\n",
      "(array([23.0903754 ,  4.35650578, 11.80172403, -1.04861969]), 0.0, True, {})\n",
      "(array([23.17750551,  4.55122145, 11.78075164, -1.46291874]), 0.0, True, {})\n",
      "(array([23.26852994,  4.36848205, 11.75149327, -1.47707244]), 0.0, True, {})\n",
      "(array([23.35589958,  4.18603767, 11.72195182, -1.50327535]), 0.0, True, {})\n",
      "(array([23.43962034,  4.00383915, 11.69188631, -1.54155034]), 0.0, True, {})\n",
      "(array([23.51969712,  4.19596485, 11.6610553 , -1.95195292]), 0.0, True, {})\n",
      "(array([23.60361642,  4.38650155, 11.62201624, -2.35968594]), 0.0, True, {})\n",
      "(array([23.69134645,  4.20262041, 11.57482253, -2.43615591]), 0.0, True, {})\n",
      "(array([23.77539886,  4.01865039, 11.52609941, -2.53114059]), 0.0, True, {})\n",
      "(array([23.85577186,  3.83442506, 11.4754766 , -2.64490453]), 0.0, True, {})\n",
      "(array([23.93246036,  3.6497547 , 11.42257851, -2.77780291]), 0.0, True, {})\n",
      "(array([24.00545546,  3.83236102, 11.36702245, -3.15884329]), 0.0, True, {})\n",
      "(array([24.08210268,  3.6449264 , 11.30384558, -3.33074491]), 0.0, True, {})\n",
      "(array([24.15500121,  3.45617713, 11.23723068, -3.52498245]), 0.0, True, {})\n",
      "(array([24.22412475,  3.63081469, 11.16673103, -3.87312875]), 0.0, True, {})\n",
      "(array([24.29674104,  3.80177577, 11.08926846, -4.20651067]), 0.0, True, {})\n",
      "(array([24.37277656,  3.60506941, 11.00513825, -4.47161623]), 0.0, True, {})\n",
      "(array([24.44487795,  3.76883965, 10.91570592, -4.76795219]), 0.0, True, {})\n",
      "(array([24.52025474,  3.5652695 , 10.82034688, -5.08537728]), 0.0, True, {})\n",
      "(array([24.59156013,  3.72196831, 10.71863933, -5.3338988 ]), 0.0, True, {})\n",
      "(array([24.6659995 ,  3.87617935, 10.61196136, -5.55345284]), 0.0, True, {})\n",
      "(array([24.74352308,  3.66167498, 10.5008923 , -5.94650934]), 0.0, True, {})\n",
      "(array([24.81675658,  3.81192567, 10.38196211, -6.09826687]), 0.0, True, {})\n",
      "(array([24.8929951 ,  3.59118526, 10.25999677, -6.52929502]), 0.0, True, {})\n",
      "(array([24.9648188 ,  3.36710373, 10.12941087, -6.97282262]), 0.0, True, {})\n",
      "(array([25.03216088,  3.51973643,  9.98995442, -6.98883767]), 0.0, True, {})\n",
      "(array([25.1025556 ,  3.67949798,  9.85017767, -6.9439172 ]), 0.0, True, {})\n",
      "(array([25.17614556,  3.46227843,  9.71129932, -7.36203598]), 0.0, True, {})\n",
      "(array([25.24539113,  3.63754404,  9.5640586 , -7.19294463]), 0.0, True, {})\n",
      "(array([25.31814201,  3.82342439,  9.42019971, -6.9576404 ]), 0.0, True, {})\n",
      "(array([25.3946105 ,  4.01882792,  9.2810469 , -6.66319218]), 0.0, True, {})\n",
      "(array([25.47498706,  3.83222348,  9.14778306, -6.89810099]), 0.0, True, {})\n",
      "(array([25.55163153,  4.04266152,  9.00982104, -6.51407718]), 0.0, True, {})\n",
      "(array([25.63248476,  4.25721274,  8.8795395 , -6.10103635]), 0.0, True, {})\n",
      "(array([25.71762901,  4.09056354,  8.75751877, -6.16229   ]), 0.0, True, {})\n",
      "(array([25.79944029,  4.3094499 ,  8.63427297, -5.72244275]), 0.0, True, {})\n",
      "(array([25.88562928,  4.15009344,  8.51982411, -5.68165209]), 0.0, True, {})\n",
      "(array([25.96863115,  3.99377815,  8.40619107, -5.59529054]), 0.0, True, {})\n",
      "(array([26.04850672,  3.83926006,  8.29428526, -5.4665717 ]), 0.0, True, {})\n",
      "(array([26.12529192,  3.68526265,  8.18495383, -5.29906656]), 0.0, True, {})\n",
      "(array([26.19899717,  3.8968532 ,  8.0789725 , -4.91788433]), 0.0, True, {})\n",
      "(array([26.27693423,  3.73883777,  7.98061481, -4.68417352]), 0.0, True, {})\n",
      "(array([26.35171099,  3.57830634,  7.88693134, -4.42293914]), 0.0, True, {})\n",
      "(array([26.42327712,  3.4146904 ,  7.79847256, -4.1371839 ]), 0.0, True, {})\n",
      "(array([26.49157092,  3.61134587,  7.71572888, -3.86000257]), 0.0, True, {})\n",
      "(array([26.56379784,  3.44089873,  7.63852883, -3.53357314]), 0.0, True, {})\n",
      "(array([26.63261582,  3.26683575,  7.56785737, -3.19055118]), 0.0, True, {})\n",
      "(array([26.69795253,  3.08931302,  7.50404634, -2.83334876]), 0.0, True, {})\n",
      "(array([26.75973879,  2.90859848,  7.44737937, -2.46423321]), 0.0, True, {})\n",
      "(array([26.81791076,  2.72503875,  7.3980947 , -2.08530876]), 0.0, True, {})\n",
      "(array([26.87241154,  2.53902923,  7.35638853, -1.6984962 ]), 0.0, True, {})\n",
      "(array([26.92319212,  2.35098958,  7.3224186 , -1.30551808]), 0.0, True, {})\n",
      "(array([26.97021191,  2.16134578,  7.29630824, -0.90789507]), 0.0, True, {})\n",
      "(array([27.01343883,  1.97051878,  7.27815034, -0.50695705]), 0.0, True, {})\n",
      "(array([27.0528492 ,  1.77891955,  7.2680112 , -0.10386959]), 0.0, True, {})\n",
      "(array([27.08842759,  1.58694939,  7.26593381,  0.30032571]), 0.0, True, {})\n",
      "(array([27.12016658,  1.395004  ,  7.27194032,  0.70466018]), 0.0, True, {})\n",
      "(array([27.14806666,  1.57476647,  7.28603352,  0.80201948]), 0.0, True, {})\n",
      "(array([27.17956199,  1.7545648 ,  7.30207391,  0.90479217]), 0.0, True, {})\n",
      "(array([27.21465329,  1.56383908,  7.32016976,  1.30514063]), 0.0, True, {})\n",
      "(array([27.24593007,  1.74432261,  7.34627257,  1.42048747]), 0.0, True, {})\n",
      "(array([27.28081652,  1.92497764,  7.37468232,  1.54565712]), 0.0, True, {})\n",
      "(array([27.31931607,  2.10587769,  7.40559546,  1.68139355]), 0.0, True, {})\n",
      "(array([27.36143363,  1.91875723,  7.43922333,  2.06800942]), 0.0, True, {})\n",
      "(array([27.39980877,  2.10122532,  7.48058352,  2.22678885]), 0.0, True, {})\n",
      "(array([27.44183328,  2.28436334,  7.5251193 ,  2.4003222 ]), 0.0, True, {})\n",
      "(array([27.48752055,  2.10212145,  7.57312574,  2.76685391]), 0.0, True, {})\n",
      "(array([27.52956297,  2.28804139,  7.62846282,  2.97203515]), 0.0, True, {})\n",
      "(array([27.5753238 ,  2.47541243,  7.68790352,  3.19574292]), 0.0, True, {})\n",
      "(array([27.62483205,  2.66456083,  7.75181838,  3.43879388]), 0.0, True, {})\n",
      "(array([27.67812327,  2.8558531 ,  7.82059426,  3.70199733]), 0.0, True, {})\n",
      "(array([27.73524033,  2.68602812,  7.89463421,  4.00433692]), 0.0, True, {})\n",
      "(array([27.78896089,  2.88297612,  7.97472094,  4.31010037]), 0.0, True, {})\n",
      "(array([27.84662041,  2.71935918,  8.06092295,  4.57239946]), 0.0, True, {})\n",
      "(array([27.9010076 ,  2.92305158,  8.15237094,  4.9229049 ]), 0.0, True, {})\n",
      "(array([27.95946863,  3.13090789,  8.25082904,  5.29557213]), 0.0, True, {})\n",
      "(array([28.02208679,  3.34316432,  8.35674048,  5.68978336]), 0.0, True, {})\n",
      "(array([28.08895007,  3.55984368,  8.47053615,  6.10401153]), 0.0, True, {})\n",
      "(array([28.16014695,  3.7806347 ,  8.59261638,  6.53538012]), 0.0, True, {})\n",
      "(array([28.23575964,  3.62950747,  8.72332398,  6.60013411]), 0.0, True, {})\n",
      "(array([28.30834979,  3.4736313 ,  8.85532666,  6.61124905]), 0.0, True, {})\n",
      "(array([28.37782242,  3.3114627 ,  8.98755164,  6.56489819]), 0.0, True, {})\n",
      "(array([28.44405167,  3.52706134,  9.11884961,  6.9823619 ]), 0.0, True, {})\n",
      "(array([28.5145929 ,  3.35154843,  9.25849685,  6.81986322]), 0.0, True, {})\n",
      "(array([28.58162387,  3.5561118 ,  9.39489411,  7.17113766]), 0.0, True, {})\n",
      "(array([28.6527461 ,  3.36292986,  9.53831686,  6.89027869]), 0.0, True, {})\n",
      "(array([28.7200047 ,  3.16113548,  9.67612244,  6.55622727]), 0.0, True, {})\n",
      "(array([28.78322741,  2.9530708 ,  9.80724698,  6.18081698]), 0.0, True, {})\n",
      "(array([28.84228883,  3.12753904,  9.93086332,  6.31388591]), 0.0, True, {})\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(array([28.90483961,  2.91120261, 10.05714104,  5.88753972]), 0.0, True, {})\n",
      "(array([28.96306366,  3.07530435, 10.17489184,  5.9123251 ]), 0.0, True, {})\n",
      "(array([29.02456975,  2.85719761, 10.29313834,  5.4725448 ]), 0.0, True, {})\n",
      "(array([29.0817137 ,  3.01616922, 10.40258923,  5.40220553]), 0.0, True, {})\n",
      "(array([29.14203708,  3.17313526, 10.51063334,  5.28997643]), 0.0, True, {})\n",
      "(array([29.20549979,  3.32924842, 10.61643287,  5.13903356]), 0.0, True, {})\n",
      "(array([29.27208476,  3.48562856, 10.71921354,  4.95273246]), 0.0, True, {})\n",
      "(array([29.34179733,  3.64328561, 10.81826819,  4.73441492]), 0.0, True, {})\n",
      "(array([29.41466304,  3.80306507, 10.91295649,  4.48729664]), 0.0, True, {})\n",
      "(array([29.49072434,  3.96561681, 11.00270242,  4.21442104]), 0.0, True, {})\n",
      "(array([29.57003668,  4.13138455, 11.08699085,  3.9186561 ]), 0.0, True, {})\n",
      "(array([29.65266437,  4.30061217, 11.16536397,  3.60271072]), 0.0, True, {})\n",
      "(array([29.73867661,  4.47336241, 11.23741818,  3.26915262]), 0.0, True, {})\n",
      "(array([29.82814386,  4.28447989, 11.30280123,  3.05156274]), 0.0, True, {})\n",
      "(array([29.91383346,  4.46319553, 11.36383249,  2.69025917]), 0.0, True, {})\n",
      "(array([30.00309737,  4.27809162, 11.41763767,  2.51592377]), 0.0, True, {})\n",
      "(array([30.0886592 ,  4.09391062, 11.46795615,  2.36089642]), 0.0, True, {})\n",
      "(array([30.17053741,  4.27924746, 11.51517408,  1.97259845]), 0.0, True, {})\n",
      "(array([30.25612236,  4.09705584, 11.55462605,  1.85309733]), 0.0, True, {})\n",
      "(array([30.33806348,  4.28585748, 11.59168799,  1.45365071]), 0.0, True, {})\n",
      "(array([30.42378063,  4.47638946, 11.62076101,  1.04990297]), 0.0, True, {})\n",
      "(array([30.51330842,  4.29588508, 11.64175907,  0.96997187]), 0.0, True, {})\n",
      "(array([30.59922612,  4.48819913, 11.6611585 ,  0.56154476]), 0.0, True, {})\n",
      "(array([30.6889901 ,  4.30796019, 11.6723894 ,  0.49724863]), 0.0, True, {})\n",
      "(array([30.77514931,  4.12766968, 11.68233437,  0.43743217]), 0.0, True, {})\n",
      "(array([30.8577027 ,  3.94732615, 11.69108301,  0.3815969 ]), 0.0, True, {})\n",
      "(array([30.93664922,  3.76693027, 11.69871495,  0.32927497]), 0.0, True, {})\n",
      "(array([31.01198783,  3.9607914 , 11.70530045, -0.08302343]), 0.0, True, {})\n",
      "(array([31.09120366,  4.15482784, 11.70363998, -0.4956931 ]), 0.0, True, {})\n",
      "(array([31.17430021,  4.34866863, 11.69372612, -0.90812284]), 0.0, True, {})\n",
      "(array([31.26127358,  4.16775985, 11.67556366, -0.95890304]), 0.0, True, {})\n",
      "(array([31.34462878,  4.36066201, 11.6563856 , -1.36945229]), 0.0, True, {})\n",
      "(array([31.43184202,  4.17931557, 11.62899656, -1.43460956]), 0.0, True, {})\n",
      "(array([31.51542833,  3.99803449, 11.60030437, -1.51062329]), 0.0, True, {})\n",
      "(array([31.59538902,  3.81676504, 11.5700919 , -1.59789562]), 0.0, True, {})\n",
      "(array([31.67172432,  3.6354437 , 11.53813399, -1.6968921 ]), 0.0, True, {})\n",
      "(array([31.7444332 ,  3.45399469, 11.50419615, -1.80813942]), 0.0, True, {})\n",
      "(array([31.81351309,  3.27232719, 11.46803336, -1.93222283]), 0.0, True, {})\n",
      "(array([31.87895964,  3.45917672, 11.4293889 , -2.32156217]), 0.0, True, {})\n",
      "(array([31.94814317,  3.64387088, 11.38295766, -2.7047788 ]), 0.0, True, {})\n",
      "(array([32.02102059,  3.82597729, 11.32886208, -3.08018429]), 0.0, True, {})\n",
      "(array([32.09754013,  3.63877396, 11.2672584 , -3.26614019]), 0.0, True, {})\n",
      "(array([32.17031561,  3.45014207, 11.20193559, -3.47342614]), 0.0, True, {})\n",
      "(array([32.23931845,  3.624404  , 11.13246707, -3.81474767]), 0.0, True, {})\n",
      "(array([32.31180653,  3.79513999, 11.05617212, -4.14094664]), 0.0, True, {})\n",
      "(array([32.38770933,  3.96224782, 10.97335318, -4.44958727]), 0.0, True, {})\n",
      "(array([32.46695429,  3.76213155, 10.88436144, -4.75018434]), 0.0, True, {})\n",
      "(array([32.54219692,  3.92222397, 10.78935775, -5.01571659]), 0.0, True, {})\n",
      "(array([32.6206414 ,  4.07942738, 10.68904342, -5.2552045 ]), 0.0, True, {})\n",
      "(array([32.70222995,  3.86851906, 10.58393933, -5.63096336]), 0.0, True, {})\n",
      "(array([32.77960033,  3.65303117, 10.47132006, -6.02973264]), 0.0, True, {})\n",
      "(array([32.85266095,  3.80300716, 10.35072541, -6.17163804]), 0.0, True, {})\n",
      "(array([32.9287211 ,  3.95446356, 10.22729265, -6.27004449]), 0.0, True, {})\n",
      "(array([33.00781037,  3.73297467, 10.10189176, -6.71233074]), 0.0, True, {})\n",
      "(array([33.08246986,  3.50972143,  9.96764514, -7.15753541]), 0.0, True, {})\n",
      "(array([33.15266429,  3.28678938,  9.82449444, -7.5957358 ]), 0.0, True, {})\n",
      "(array([33.21840008,  3.06705632,  9.67257972, -8.01376571]), 0.0, True, {})\n",
      "(array([33.2797412 ,  3.24262791,  9.51230441, -7.83056326]), 0.0, True, {})\n",
      "(array([33.34459376,  3.43116625,  9.35569314, -7.57453827]), 0.0, True, {})\n",
      "(array([33.41321709,  3.63107003,  9.20420238, -7.25510309]), 0.0, True, {})\n",
      "(array([33.48583849,  3.8397583 ,  9.05910031, -6.88533029]), 0.0, True, {})\n",
      "(array([33.56263365,  4.05420181,  8.92139371, -6.47980382]), 0.0, True, {})\n",
      "(array([33.64371769,  3.88773497,  8.79179763, -6.55670656]), 0.0, True, {})\n",
      "(array([33.72147239,  3.72834501,  8.6606635 , -6.57555731]), 0.0, True, {})\n",
      "(array([33.79603929,  3.95198405,  8.52915235, -6.12993981]), 0.0, True, {})\n",
      "(array([33.87507897,  3.79928405,  8.40655356, -6.04360659]), 0.0, True, {})\n",
      "(array([33.95106465,  4.01947171,  8.28568143, -5.62000291]), 0.0, True, {})\n",
      "(array([34.03145409,  4.23502024,  8.17328137, -5.2176925 ]), 0.0, True, {})\n",
      "(array([34.11615449,  4.44573534,  8.06892752, -4.83933683]), 0.0, True, {})\n",
      "(array([34.2050692 ,  4.65177767,  7.97214078, -4.48618082]), 0.0, True, {})\n",
      "(array([34.29810475,  4.48953877,  7.88241716, -4.22291893]), 0.0, True, {})\n",
      "(array([34.38789553,  4.68795299,  7.79795879, -3.92057591]), 0.0, True, {})\n",
      "(array([34.48165459,  4.88301741,  7.71954727, -3.64342068]), 0.0, True, {})\n",
      "(array([34.57931493,  5.07525494,  7.64667885, -3.39072169]), 0.0, True, {})\n",
      "(array([34.68082003,  4.90046832,  7.57886442, -3.04905416]), 0.0, True, {})\n",
      "(array([34.7788294 ,  5.08786936,  7.51788334, -2.84247449]), 0.0, True, {})\n",
      "(array([34.88058679,  4.90748677,  7.46103385, -2.47568724]), 0.0, True, {})\n",
      "(array([34.97873652,  4.72425692,  7.4115201 , -2.09885295]), 0.0, True, {})\n",
      "(array([35.07322166,  4.90680508,  7.36954304, -1.95040618]), 0.0, True, {})\n",
      "(array([35.17135776,  4.71977397,  7.33053492, -1.559581  ]), 0.0, True, {})\n",
      "(array([35.26575324,  4.53086697,  7.2993433 , -1.16330425]), 0.0, True, {})\n",
      "(array([35.35637058,  4.71115751,  7.27607722, -1.05579871]), 0.0, True, {})\n",
      "(array([35.45059373,  4.8913766 ,  7.25496124, -0.95721398]), 0.0, True, {})\n",
      "(array([35.54842126,  4.69987243,  7.23581696, -0.55243805]), 0.0, True, {})\n",
      "(array([35.64241871,  4.87972377,  7.2247682 , -0.46919135]), 0.0, True, {})\n",
      "(array([35.74001319,  4.6871617 ,  7.21538437, -0.06150833]), 0.0, True, {})\n",
      "(array([3.58337564e+01, 4.86694192e+00, 7.21415421e+00, 1.38115587e-02]), 0.0, True, {})\n",
      "(array([35.93109526,  5.0467294 ,  7.21443044,  0.08864295]), 0.0, True, {})\n",
      "(array([36.03202985,  5.22652037,  7.2162033 ,  0.16357945]), 0.0, True, {})\n",
      "(array([36.13656025,  5.03366747,  7.21947489,  0.57202548]), 0.0, True, {})\n",
      "(array([36.2372336 ,  4.8410953 ,  7.2309154 ,  0.98003205]), 0.0, True, {})\n",
      "(array([36.33405551,  4.64919832,  7.25051604,  1.38675328]), 0.0, True, {})\n",
      "(array([36.42703948,  4.83018581,  7.2782511 ,  1.47475977]), 0.0, True, {})\n",
      "(array([36.52364319,  4.64008104,  7.3077463 ,  1.87661859]), 0.0, True, {})\n",
      "(array([36.61644481,  4.82205108,  7.34527867,  1.98604446]), 0.0, True, {})\n",
      "(array([36.71288583,  5.0042635 ,  7.38499956,  2.10969886]), 0.0, True, {})\n",
      "(array([36.8129711 ,  4.81807338,  7.42719354,  2.49818623]), 0.0, True, {})\n",
      "(array([36.90933257,  5.00217142,  7.47715726,  2.65150359]), 0.0, True, {})\n",
      "(array([37.009376  ,  4.82004235,  7.53018733,  3.02540284]), 0.0, True, {})\n",
      "(array([37.10577685,  5.00700864,  7.59069539,  3.21489567]), 0.0, True, {})\n",
      "(array([37.20591702,  4.83008748,  7.6549933 ,  3.56783132]), 0.0, True, {})\n",
      "(array([37.30251877,  5.02116905,  7.72634993,  3.79937098]), 0.0, True, {})\n",
      "(array([37.40294215,  5.21452985,  7.80233735,  4.05406159]), 0.0, True, {})\n",
      "(array([37.50723275,  5.04691365,  7.88341858,  4.36064847]), 0.0, True, {})\n",
      "(array([37.60817102,  4.88275804,  7.97063155,  4.64727378]), 0.0, True, {})\n",
      "(array([37.70582618,  5.08580886,  8.06357703,  4.97472406]), 0.0, True, {})\n",
      "(array([37.80754236,  4.92825098,  8.16307151,  5.2131167 ]), 0.0, True, {})\n",
      "(array([37.90610738,  5.13880521,  8.26733384,  5.58925758]), 0.0, True, {})\n",
      "(array([38.00888348,  5.3539136 ,  8.37911899,  5.98810432]), 0.0, True, {})\n",
      "(array([38.11596175,  5.57349679,  8.49888108,  6.40761539]), 0.0, True, {})\n"
     ]
    }
   ],
   "source": [
    "env.reset()\n",
    "for _ in range(1000):\n",
    "    env.render()\n",
    "    print(env.step(env.action_space.sample()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 170,
   "metadata": {},
   "outputs": [],
   "source": [
    "from collections import namedtuple\n",
    "import random\n",
    "\n",
    "Transition = namedtuple('Transition',\n",
    "                        ('state', 'action', 'next_state', 'reward', 'done'))\n",
    "\n",
    "\n",
    "class ReplayMemory(object):\n",
    "\n",
    "    def __init__(self, capacity):\n",
    "        self.capacity = capacity\n",
    "        self.memory = []\n",
    "        self.position = 0\n",
    "\n",
    "    def push(self, *args):\n",
    "        \"\"\"Saves a transition.\"\"\"\n",
    "        if len(self.memory) < self.capacity:\n",
    "            self.memory.append(None)\n",
    "        args = [torch.tensor(x) for x in args]\n",
    "        self.memory[self.position] = Transition(*args)\n",
    "        self.position = (self.position + 1) % self.capacity\n",
    "\n",
    "    def sample(self, batch_size):\n",
    "        return random.sample(self.memory, batch_size)\n",
    "\n",
    "    def __len__(self):\n",
    "        return len(self.memory)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 171,
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch.nn as nn\n",
    "import torch.nn.functional as F\n",
    "import torch\n",
    "\n",
    "class DQN(nn.Module):\n",
    "    def __init__(self):\n",
    "        super().__init__()\n",
    "        self.fc1 = nn.Linear(4, 4)\n",
    "        self.fc2 = nn.Linear(4, 2)\n",
    "        \n",
    "    def forward(self, x):\n",
    "        x = F.relu(self.fc1(x))\n",
    "        x = self.fc2(x)\n",
    "        return x\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 196,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 1000/1000 [06:12<00:00,  2.68it/s]\n"
     ]
    }
   ],
   "source": [
    "from tqdm import tqdm\n",
    "import numpy as np\n",
    "import torch.optim as optim\n",
    "\n",
    "memory_length = 1000\n",
    "\n",
    "policy_net = DQN()\n",
    "target_net = DQN()\n",
    "optimizer = optim.Adam(policy_net.parameters(), lr=0.01)\n",
    "# Clopy the network\n",
    "target_net.load_state_dict(policy_net.state_dict())\n",
    "memory = ReplayMemory(10000)\n",
    "\n",
    "\n",
    "n_episode = 1000\n",
    "render_step = 1\n",
    "\n",
    "BATCH_SIZE = 128\n",
    "GAMMA = 0.99\n",
    "EPS_START = 0.9\n",
    "EPS_END = 0.1\n",
    "EPS_DECAY = 20000\n",
    "TARGET_UPDATE = 10\n",
    "\n",
    "def get_eps(step):\n",
    "    return max(EPS_END, EPS_END + step * (EPS_START - EPS_END) / EPS_DECAY)\n",
    "\n",
    "\n",
    "for _ in tqdm(range(n_episode)):\n",
    "    done = False\n",
    "    old_obs = env.reset()\n",
    "    old_obs = torch.from_numpy(old_obs).float()\n",
    "    step = 0\n",
    "    global_step = 0\n",
    "    while not done:\n",
    "        eps = get_eps(global_step)\n",
    "        if True or np.random.uniform() < eps:\n",
    "            action = env.action_space.sample()\n",
    "        else:\n",
    "            action = policy_net(old_obs)\n",
    "        obs, reward, done, info = env.step(action)\n",
    "        obs = torch.from_numpy(obs).float()\n",
    "        memory.push(old_obs, action, obs_tensor,  reward, done)\n",
    "        old_obs = obs\n",
    "        step += 1\n",
    "        global_step += 1\n",
    "        if step % render_step == 0:\n",
    "            env.render()\n",
    "            \n",
    "        # Training\n",
    "        if len(memory) >= BATCH_SIZE:\n",
    "            batch =  Transition(*zip(*memory.sample(BATCH_SIZE)))\n",
    "            batch_state = torch.cat([x.unsqueeze(0) for x in batch.state])\n",
    "            batch_action = torch.cat([x.unsqueeze(0) for x in batch.action])\n",
    "            batch_reward = torch.cat([x.unsqueeze(0) for x in batch.reward])\n",
    "            batch_done = torch.cat([x.unsqueeze(0) for x in batch.done])\n",
    "            batch_next_state = torch.cat([x.unsqueeze(0) for x in batch.next_state])\n",
    "            # Build State Action Value\n",
    "            batch_output = policy_net(batch_state)\n",
    "            state_action_values = batch_output.gather(1, batch_action.unsqueeze(1)).squeeze(1)\n",
    "            # Build Target\n",
    "            batch_target = target_net(batch_next_state)\n",
    "            next_state_values = torch.zeros(BATCH_SIZE)\n",
    "            batch_max = batch_target.max(1)[0].detach()\n",
    "            next_state_values[batch_done] = batch_max[batch_done]\n",
    "            target = batch_reward + GAMMA * next_state_values\n",
    "            # Optimization\n",
    "            loss = F.smooth_l1_loss(state_action_values, target)\n",
    "            optimizer.zero_grad()\n",
    "            loss.backward()\n",
    "            for param in policy_net.parameters():\n",
    "                param.grad.data.clamp_(-1, 1)\n",
    "            optimizer.step()\n",
    "        \n",
    "        if global_step % TARGET_UPDATE == 0:\n",
    "            target_net.load_state_dict(policy_net.state_dict())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 162,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "torch.Size([2, 3])"
      ]
     },
     "execution_count": 162,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "torch.cat([torch.ones(3).unsqueeze(0), torch.ones(3).unsqueeze(0)]).shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 189,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function smooth_l1_loss:\n",
      "\n",
      "smooth_l1_loss(...)\n",
      "    smooth_l1_loss(input, target, size_average=True, reduce=True) -> Tensor\n",
      "    \n",
      "    Function that uses a squared term if the absolute\n",
      "    element-wise error falls below 1 and an L1 term otherwise.\n",
      "    \n",
      "    See :class:`~torch.nn.SmoothL1Loss` for details.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(F.smooth_l1_loss)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 190,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'pytorch' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-190-a6a940fb3671>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mhelp\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpytorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdetach\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m: name 'pytorch' is not defined"
     ]
    }
   ],
   "source": [
    "help(pytorch.detach)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 169,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor(2.3467)"
      ]
     },
     "execution_count": 169,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "torch.randn(3).max(0)[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([[-0.2590, -1.5937,  0.2239,  2.2517]])"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "obs_.float()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {},
   "outputs": [],
   "source": [
    "transtions = memory.sample(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "metadata": {},
   "outputs": [],
   "source": [
    "x = Transition(*zip(*transtions))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(array([ 0.03294487,  0.41692597, -0.00334764, -0.50945142]), array([ 0.03827552,  0.02455782, -0.02828325, -0.11777853]), array([-0.01849946, -0.82277953,  0.06185798,  1.21121157]))\n"
     ]
    }
   ],
   "source": [
    "for i in x:\n",
    "    print(i)\n",
    "    break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[(array([ 0.03294487,  0.41692597, -0.00334764, -0.50945142]),\n",
       "  array([ 0.03827552,  0.02455782, -0.02828325, -0.11777853]),\n",
       "  array([-0.01849946, -0.82277953,  0.06185798,  1.21121157])),\n",
       " (1, 0, 0),\n",
       " (array([ 0.04128339,  0.61209492, -0.01353667, -0.80318742]),\n",
       "  array([ 0.03876668, -0.17014772, -0.03063882,  0.16584879]),\n",
       "  array([-0.03495505, -1.01864311,  0.08608221,  1.52261968])),\n",
       " (1.0, 1.0, 1.0)]"
      ]
     },
     "execution_count": 108,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transition(state=(array([ 0.03294487,  0.41692597, -0.00334764, -0.50945142]), array([ 0.03827552,  0.02455782, -0.02828325, -0.11777853]), array([-0.01849946, -0.82277953,  0.06185798,  1.21121157])), action=(1, 0, 0), next_state=(array([ 0.04128339,  0.61209492, -0.01353667, -0.80318742]), array([ 0.03876668, -0.17014772, -0.03063882,  0.16584879]), array([-0.03495505, -1.01864311,  0.08608221,  1.52261968])), reward=(1.0, 1.0, 1.0))"
      ]
     },
     "execution_count": 113,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 135,
   "metadata": {},
   "outputs": [],
   "source": [
    "x = torch.ones(3, dtype=torch.long).unsqueeze(1)\n",
    "y = torch.randn((3, 5))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 136,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([[ 0.5968],\n",
       "        [-0.0092],\n",
       "        [ 1.6653]])"
      ]
     },
     "execution_count": 136,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y.gather(1, x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 186,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 186,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x.requires_grad"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "eye(): argument 'n' (position 1) must be int, not Tensor",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-133-30d361029cec>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0meye\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mTypeError\u001b[0m: eye(): argument 'n' (position 1) must be int, not Tensor"
     ]
    }
   ],
   "source": [
    "torch.eye(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 134,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function eye:\n",
      "\n",
      "eye(...)\n",
      "    eye(n, m=None, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False) -> Tensor\n",
      "    \n",
      "    Returns a 2-D tensor with ones on the diagonal and zeros elsewhere.\n",
      "    \n",
      "    Args:\n",
      "        n (int): the number of rows\n",
      "        m (int, optional): the number of columns with default being :attr:`n`\n",
      "        out (Tensor, optional): the output tensor\n",
      "        dtype (:class:`torch.dtype`, optional): the desired data type of returned tensor.\n",
      "        layout (:class:`torch.layout`, optional): the desired layout of returned Tensor.\n",
      "        device (:class:`torch.device`, optional): the desired device of returned tensor.\n",
      "        requires_grad (bool, optional): If autograd should record operations on the\n",
      "    \n",
      "    Returns:\n",
      "        Tensor: A 2-D tensor with ones on the diagonal and zeros elsewhere\n",
      "    \n",
      "    Example::\n",
      "    \n",
      "        >>> torch.eye(3)\n",
      "        tensor([[ 1.,  0.,  0.],\n",
      "                [ 0.,  1.,  0.],\n",
      "                [ 0.,  0.,  1.]])\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(torch.eye)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 212,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "218232.90460000018"
      ]
     },
     "execution_count": 212,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(1.1 ** 5 - 1) / 0.1 * 35746"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 209,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.7715610000000008"
      ]
     },
     "execution_count": 209,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "1.1 ** 6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 213,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<ufunc 'log1p'>"
      ]
     },
     "execution_count": 213,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.log1p"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 214,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on ufunc object:\n",
      "\n",
      "log1p = class ufunc(builtins.object)\n",
      " |  Functions that operate element by element on whole arrays.\n",
      " |  \n",
      " |  To see the documentation for a specific ufunc, use `info`.  For\n",
      " |  example, ``np.info(np.sin)``.  Because ufuncs are written in C\n",
      " |  (for speed) and linked into Python with NumPy's ufunc facility,\n",
      " |  Python's help() function finds this page whenever help() is called\n",
      " |  on a ufunc.\n",
      " |  \n",
      " |  A detailed explanation of ufuncs can be found in the docs for :ref:`ufuncs`.\n",
      " |  \n",
      " |  Calling ufuncs:\n",
      " |  ===============\n",
      " |  \n",
      " |  op(*x[, out], where=True, **kwargs)\n",
      " |  Apply `op` to the arguments `*x` elementwise, broadcasting the arguments.\n",
      " |  \n",
      " |  The broadcasting rules are:\n",
      " |  \n",
      " |  * Dimensions of length 1 may be prepended to either array.\n",
      " |  * Arrays may be repeated along dimensions of length 1.\n",
      " |  \n",
      " |  Parameters\n",
      " |  ----------\n",
      " |  *x : array_like\n",
      " |      Input arrays.\n",
      " |  out : ndarray, None, or tuple of ndarray and None, optional\n",
      " |      Alternate array object(s) in which to put the result; if provided, it\n",
      " |      must have a shape that the inputs broadcast to. A tuple of arrays\n",
      " |      (possible only as a keyword argument) must have length equal to the\n",
      " |      number of outputs; use `None` for outputs to be allocated by the ufunc.\n",
      " |  where : array_like, optional\n",
      " |      Values of True indicate to calculate the ufunc at that position, values\n",
      " |      of False indicate to leave the value in the output alone.\n",
      " |  **kwargs\n",
      " |      For other keyword-only arguments, see the :ref:`ufunc docs <ufuncs.kwargs>`.\n",
      " |  \n",
      " |  Returns\n",
      " |  -------\n",
      " |  r : ndarray or tuple of ndarray\n",
      " |      `r` will have the shape that the arrays in `x` broadcast to; if `out` is\n",
      " |      provided, `r` will be equal to `out`. If the function has more than one\n",
      " |      output, then the result will be a tuple of arrays.\n",
      " |  \n",
      " |  Methods defined here:\n",
      " |  \n",
      " |  __call__(self, /, *args, **kwargs)\n",
      " |      Call self as a function.\n",
      " |  \n",
      " |  __repr__(self, /)\n",
      " |      Return repr(self).\n",
      " |  \n",
      " |  __str__(self, /)\n",
      " |      Return str(self).\n",
      " |  \n",
      " |  accumulate(...)\n",
      " |      accumulate(array, axis=0, dtype=None, out=None)\n",
      " |      \n",
      " |      Accumulate the result of applying the operator to all elements.\n",
      " |      \n",
      " |      For a one-dimensional array, accumulate produces results equivalent to::\n",
      " |      \n",
      " |        r = np.empty(len(A))\n",
      " |        t = op.identity        # op = the ufunc being applied to A's  elements\n",
      " |        for i in range(len(A)):\n",
      " |            t = op(t, A[i])\n",
      " |            r[i] = t\n",
      " |        return r\n",
      " |      \n",
      " |      For example, add.accumulate() is equivalent to np.cumsum().\n",
      " |      \n",
      " |      For a multi-dimensional array, accumulate is applied along only one\n",
      " |      axis (axis zero by default; see Examples below) so repeated use is\n",
      " |      necessary if one wants to accumulate over multiple axes.\n",
      " |      \n",
      " |      Parameters\n",
      " |      ----------\n",
      " |      array : array_like\n",
      " |          The array to act on.\n",
      " |      axis : int, optional\n",
      " |          The axis along which to apply the accumulation; default is zero.\n",
      " |      dtype : data-type code, optional\n",
      " |          The data-type used to represent the intermediate results. Defaults\n",
      " |          to the data-type of the output array if such is provided, or the\n",
      " |          the data-type of the input array if no output array is provided.\n",
      " |      out : ndarray, None, or tuple of ndarray and None, optional\n",
      " |          A location into which the result is stored. If not provided or `None`,\n",
      " |          a freshly-allocated array is returned. For consistency with\n",
      " |          :ref:`ufunc.__call__`, if given as a keyword, this may be wrapped in a\n",
      " |          1-element tuple.\n",
      " |      \n",
      " |          .. versionchanged:: 1.13.0\n",
      " |             Tuples are allowed for keyword argument.\n",
      " |      \n",
      " |      Returns\n",
      " |      -------\n",
      " |      r : ndarray\n",
      " |          The accumulated values. If `out` was supplied, `r` is a reference to\n",
      " |          `out`.\n",
      " |      \n",
      " |      Examples\n",
      " |      --------\n",
      " |      1-D array examples:\n",
      " |      \n",
      " |      >>> np.add.accumulate([2, 3, 5])\n",
      " |      array([ 2,  5, 10])\n",
      " |      >>> np.multiply.accumulate([2, 3, 5])\n",
      " |      array([ 2,  6, 30])\n",
      " |      \n",
      " |      2-D array examples:\n",
      " |      \n",
      " |      >>> I = np.eye(2)\n",
      " |      >>> I\n",
      " |      array([[ 1.,  0.],\n",
      " |             [ 0.,  1.]])\n",
      " |      \n",
      " |      Accumulate along axis 0 (rows), down columns:\n",
      " |      \n",
      " |      >>> np.add.accumulate(I, 0)\n",
      " |      array([[ 1.,  0.],\n",
      " |             [ 1.,  1.]])\n",
      " |      >>> np.add.accumulate(I) # no axis specified = axis zero\n",
      " |      array([[ 1.,  0.],\n",
      " |             [ 1.,  1.]])\n",
      " |      \n",
      " |      Accumulate along axis 1 (columns), through rows:\n",
      " |      \n",
      " |      >>> np.add.accumulate(I, 1)\n",
      " |      array([[ 1.,  1.],\n",
      " |             [ 0.,  1.]])\n",
      " |  \n",
      " |  at(...)\n",
      " |      at(a, indices, b=None)\n",
      " |      \n",
      " |      Performs unbuffered in place operation on operand 'a' for elements\n",
      " |      specified by 'indices'. For addition ufunc, this method is equivalent to\n",
      " |      `a[indices] += b`, except that results are accumulated for elements that\n",
      " |      are indexed more than once. For example, `a[[0,0]] += 1` will only\n",
      " |      increment the first element once because of buffering, whereas\n",
      " |      `add.at(a, [0,0], 1)` will increment the first element twice.\n",
      " |      \n",
      " |      .. versionadded:: 1.8.0\n",
      " |      \n",
      " |      Parameters\n",
      " |      ----------\n",
      " |      a : array_like\n",
      " |          The array to perform in place operation on.\n",
      " |      indices : array_like or tuple\n",
      " |          Array like index object or slice object for indexing into first\n",
      " |          operand. If first operand has multiple dimensions, indices can be a\n",
      " |          tuple of array like index objects or slice objects.\n",
      " |      b : array_like\n",
      " |          Second operand for ufuncs requiring two operands. Operand must be\n",
      " |          broadcastable over first operand after indexing or slicing.\n",
      " |      \n",
      " |      Examples\n",
      " |      --------\n",
      " |      Set items 0 and 1 to their negative values:\n",
      " |      \n",
      " |      >>> a = np.array([1, 2, 3, 4])\n",
      " |      >>> np.negative.at(a, [0, 1])\n",
      " |      >>> print(a)\n",
      " |      array([-1, -2, 3, 4])\n",
      " |      \n",
      " |      ::\n",
      " |      \n",
      " |      Increment items 0 and 1, and increment item 2 twice:\n",
      " |      \n",
      " |      >>> a = np.array([1, 2, 3, 4])\n",
      " |      >>> np.add.at(a, [0, 1, 2, 2], 1)\n",
      " |      >>> print(a)\n",
      " |      array([2, 3, 5, 4])\n",
      " |      \n",
      " |      ::\n",
      " |      \n",
      " |      Add items 0 and 1 in first array to second array,\n",
      " |      and store results in first array:\n",
      " |      \n",
      " |      >>> a = np.array([1, 2, 3, 4])\n",
      " |      >>> b = np.array([1, 2])\n",
      " |      >>> np.add.at(a, [0, 1], b)\n",
      " |      >>> print(a)\n",
      " |      array([2, 4, 3, 4])\n",
      " |  \n",
      " |  outer(...)\n",
      " |      outer(A, B, **kwargs)\n",
      " |      \n",
      " |      Apply the ufunc `op` to all pairs (a, b) with a in `A` and b in `B`.\n",
      " |      \n",
      " |      Let ``M = A.ndim``, ``N = B.ndim``. Then the result, `C`, of\n",
      " |      ``op.outer(A, B)`` is an array of dimension M + N such that:\n",
      " |      \n",
      " |      .. math:: C[i_0, ..., i_{M-1}, j_0, ..., j_{N-1}] =\n",
      " |         op(A[i_0, ..., i_{M-1}], B[j_0, ..., j_{N-1}])\n",
      " |      \n",
      " |      For `A` and `B` one-dimensional, this is equivalent to::\n",
      " |      \n",
      " |        r = empty(len(A),len(B))\n",
      " |        for i in range(len(A)):\n",
      " |            for j in range(len(B)):\n",
      " |                r[i,j] = op(A[i], B[j]) # op = ufunc in question\n",
      " |      \n",
      " |      Parameters\n",
      " |      ----------\n",
      " |      A : array_like\n",
      " |          First array\n",
      " |      B : array_like\n",
      " |          Second array\n",
      " |      kwargs : any\n",
      " |          Arguments to pass on to the ufunc. Typically `dtype` or `out`.\n",
      " |      \n",
      " |      Returns\n",
      " |      -------\n",
      " |      r : ndarray\n",
      " |          Output array\n",
      " |      \n",
      " |      See Also\n",
      " |      --------\n",
      " |      numpy.outer\n",
      " |      \n",
      " |      Examples\n",
      " |      --------\n",
      " |      >>> np.multiply.outer([1, 2, 3], [4, 5, 6])\n",
      " |      array([[ 4,  5,  6],\n",
      " |             [ 8, 10, 12],\n",
      " |             [12, 15, 18]])\n",
      " |      \n",
      " |      A multi-dimensional example:\n",
      " |      \n",
      " |      >>> A = np.array([[1, 2, 3], [4, 5, 6]])\n",
      " |      >>> A.shape\n",
      " |      (2, 3)\n",
      " |      >>> B = np.array([[1, 2, 3, 4]])\n",
      " |      >>> B.shape\n",
      " |      (1, 4)\n",
      " |      >>> C = np.multiply.outer(A, B)\n",
      " |      >>> C.shape; C\n",
      " |      (2, 3, 1, 4)\n",
      " |      array([[[[ 1,  2,  3,  4]],\n",
      " |              [[ 2,  4,  6,  8]],\n",
      " |              [[ 3,  6,  9, 12]]],\n",
      " |             [[[ 4,  8, 12, 16]],\n",
      " |              [[ 5, 10, 15, 20]],\n",
      " |              [[ 6, 12, 18, 24]]]])\n",
      " |  \n",
      " |  reduce(...)\n",
      " |      reduce(a, axis=0, dtype=None, out=None, keepdims=False)\n",
      " |      \n",
      " |      Reduces `a`'s dimension by one, by applying ufunc along one axis.\n",
      " |      \n",
      " |      Let :math:`a.shape = (N_0, ..., N_i, ..., N_{M-1})`.  Then\n",
      " |      :math:`ufunc.reduce(a, axis=i)[k_0, ..,k_{i-1}, k_{i+1}, .., k_{M-1}]` =\n",
      " |      the result of iterating `j` over :math:`range(N_i)`, cumulatively applying\n",
      " |      ufunc to each :math:`a[k_0, ..,k_{i-1}, j, k_{i+1}, .., k_{M-1}]`.\n",
      " |      For a one-dimensional array, reduce produces results equivalent to:\n",
      " |      ::\n",
      " |      \n",
      " |       r = op.identity # op = ufunc\n",
      " |       for i in range(len(A)):\n",
      " |         r = op(r, A[i])\n",
      " |       return r\n",
      " |      \n",
      " |      For example, add.reduce() is equivalent to sum().\n",
      " |      \n",
      " |      Parameters\n",
      " |      ----------\n",
      " |      a : array_like\n",
      " |          The array to act on.\n",
      " |      axis : None or int or tuple of ints, optional\n",
      " |          Axis or axes along which a reduction is performed.\n",
      " |          The default (`axis` = 0) is perform a reduction over the first\n",
      " |          dimension of the input array. `axis` may be negative, in\n",
      " |          which case it counts from the last to the first axis.\n",
      " |      \n",
      " |          .. versionadded:: 1.7.0\n",
      " |      \n",
      " |          If this is `None`, a reduction is performed over all the axes.\n",
      " |          If this is a tuple of ints, a reduction is performed on multiple\n",
      " |          axes, instead of a single axis or all the axes as before.\n",
      " |      \n",
      " |          For operations which are either not commutative or not associative,\n",
      " |          doing a reduction over multiple axes is not well-defined. The\n",
      " |          ufuncs do not currently raise an exception in this case, but will\n",
      " |          likely do so in the future.\n",
      " |      dtype : data-type code, optional\n",
      " |          The type used to represent the intermediate results. Defaults\n",
      " |          to the data-type of the output array if this is provided, or\n",
      " |          the data-type of the input array if no output array is provided.\n",
      " |      out : ndarray, None, or tuple of ndarray and None, optional\n",
      " |          A location into which the result is stored. If not provided or `None`,\n",
      " |          a freshly-allocated array is returned. For consistency with\n",
      " |          :ref:`ufunc.__call__`, if given as a keyword, this may be wrapped in a\n",
      " |          1-element tuple.\n",
      " |      \n",
      " |          .. versionchanged:: 1.13.0\n",
      " |             Tuples are allowed for keyword argument.\n",
      " |      keepdims : bool, optional\n",
      " |          If this is set to True, the axes which are reduced are left\n",
      " |          in the result as dimensions with size one. With this option,\n",
      " |          the result will broadcast correctly against the original `arr`.\n",
      " |      \n",
      " |          .. versionadded:: 1.7.0\n",
      " |      \n",
      " |      Returns\n",
      " |      -------\n",
      " |      r : ndarray\n",
      " |          The reduced array. If `out` was supplied, `r` is a reference to it.\n",
      " |      \n",
      " |      Examples\n",
      " |      --------\n",
      " |      >>> np.multiply.reduce([2,3,5])\n",
      " |      30\n",
      " |      \n",
      " |      A multi-dimensional array example:\n",
      " |      \n",
      " |      >>> X = np.arange(8).reshape((2,2,2))\n",
      " |      >>> X\n",
      " |      array([[[0, 1],\n",
      " |              [2, 3]],\n",
      " |             [[4, 5],\n",
      " |              [6, 7]]])\n",
      " |      >>> np.add.reduce(X, 0)\n",
      " |      array([[ 4,  6],\n",
      " |             [ 8, 10]])\n",
      " |      >>> np.add.reduce(X) # confirm: default axis value is 0\n",
      " |      array([[ 4,  6],\n",
      " |             [ 8, 10]])\n",
      " |      >>> np.add.reduce(X, 1)\n",
      " |      array([[ 2,  4],\n",
      " |             [10, 12]])\n",
      " |      >>> np.add.reduce(X, 2)\n",
      " |      array([[ 1,  5],\n",
      " |             [ 9, 13]])\n",
      " |  \n",
      " |  reduceat(...)\n",
      " |      reduceat(a, indices, axis=0, dtype=None, out=None)\n",
      " |      \n",
      " |      Performs a (local) reduce with specified slices over a single axis.\n",
      " |      \n",
      " |      For i in ``range(len(indices))``, `reduceat` computes\n",
      " |      ``ufunc.reduce(a[indices[i]:indices[i+1]])``, which becomes the i-th\n",
      " |      generalized \"row\" parallel to `axis` in the final result (i.e., in a\n",
      " |      2-D array, for example, if `axis = 0`, it becomes the i-th row, but if\n",
      " |      `axis = 1`, it becomes the i-th column).  There are three exceptions to this:\n",
      " |      \n",
      " |      * when ``i = len(indices) - 1`` (so for the last index),\n",
      " |        ``indices[i+1] = a.shape[axis]``.\n",
      " |      * if ``indices[i] >= indices[i + 1]``, the i-th generalized \"row\" is\n",
      " |        simply ``a[indices[i]]``.\n",
      " |      * if ``indices[i] >= len(a)`` or ``indices[i] < 0``, an error is raised.\n",
      " |      \n",
      " |      The shape of the output depends on the size of `indices`, and may be\n",
      " |      larger than `a` (this happens if ``len(indices) > a.shape[axis]``).\n",
      " |      \n",
      " |      Parameters\n",
      " |      ----------\n",
      " |      a : array_like\n",
      " |          The array to act on.\n",
      " |      indices : array_like\n",
      " |          Paired indices, comma separated (not colon), specifying slices to\n",
      " |          reduce.\n",
      " |      axis : int, optional\n",
      " |          The axis along which to apply the reduceat.\n",
      " |      dtype : data-type code, optional\n",
      " |          The type used to represent the intermediate results. Defaults\n",
      " |          to the data type of the output array if this is provided, or\n",
      " |          the data type of the input array if no output array is provided.\n",
      " |      out : ndarray, None, or tuple of ndarray and None, optional\n",
      " |          A location into which the result is stored. If not provided or `None`,\n",
      " |          a freshly-allocated array is returned. For consistency with\n",
      " |          :ref:`ufunc.__call__`, if given as a keyword, this may be wrapped in a\n",
      " |          1-element tuple.\n",
      " |      \n",
      " |          .. versionchanged:: 1.13.0\n",
      " |             Tuples are allowed for keyword argument.\n",
      " |      \n",
      " |      Returns\n",
      " |      -------\n",
      " |      r : ndarray\n",
      " |          The reduced values. If `out` was supplied, `r` is a reference to\n",
      " |          `out`.\n",
      " |      \n",
      " |      Notes\n",
      " |      -----\n",
      " |      A descriptive example:\n",
      " |      \n",
      " |      If `a` is 1-D, the function `ufunc.accumulate(a)` is the same as\n",
      " |      ``ufunc.reduceat(a, indices)[::2]`` where `indices` is\n",
      " |      ``range(len(array) - 1)`` with a zero placed\n",
      " |      in every other element:\n",
      " |      ``indices = zeros(2 * len(a) - 1)``, ``indices[1::2] = range(1, len(a))``.\n",
      " |      \n",
      " |      Don't be fooled by this attribute's name: `reduceat(a)` is not\n",
      " |      necessarily smaller than `a`.\n",
      " |      \n",
      " |      Examples\n",
      " |      --------\n",
      " |      To take the running sum of four successive values:\n",
      " |      \n",
      " |      >>> np.add.reduceat(np.arange(8),[0,4, 1,5, 2,6, 3,7])[::2]\n",
      " |      array([ 6, 10, 14, 18])\n",
      " |      \n",
      " |      A 2-D example:\n",
      " |      \n",
      " |      >>> x = np.linspace(0, 15, 16).reshape(4,4)\n",
      " |      >>> x\n",
      " |      array([[  0.,   1.,   2.,   3.],\n",
      " |             [  4.,   5.,   6.,   7.],\n",
      " |             [  8.,   9.,  10.,  11.],\n",
      " |             [ 12.,  13.,  14.,  15.]])\n",
      " |      \n",
      " |      ::\n",
      " |      \n",
      " |       # reduce such that the result has the following five rows:\n",
      " |       # [row1 + row2 + row3]\n",
      " |       # [row4]\n",
      " |       # [row2]\n",
      " |       # [row3]\n",
      " |       # [row1 + row2 + row3 + row4]\n",
      " |      \n",
      " |      >>> np.add.reduceat(x, [0, 3, 1, 2, 0])\n",
      " |      array([[ 12.,  15.,  18.,  21.],\n",
      " |             [ 12.,  13.,  14.,  15.],\n",
      " |             [  4.,   5.,   6.,   7.],\n",
      " |             [  8.,   9.,  10.,  11.],\n",
      " |             [ 24.,  28.,  32.,  36.]])\n",
      " |      \n",
      " |      ::\n",
      " |      \n",
      " |       # reduce such that result has the following two columns:\n",
      " |       # [col1 * col2 * col3, col4]\n",
      " |      \n",
      " |      >>> np.multiply.reduceat(x, [0, 3], 1)\n",
      " |      array([[    0.,     3.],\n",
      " |             [  120.,     7.],\n",
      " |             [  720.,    11.],\n",
      " |             [ 2184.,    15.]])\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Data descriptors defined here:\n",
      " |  \n",
      " |  identity\n",
      " |      The identity value.\n",
      " |      \n",
      " |      Data attribute containing the identity element for the ufunc, if it has one.\n",
      " |      If it does not, the attribute value is None.\n",
      " |      \n",
      " |      Examples\n",
      " |      --------\n",
      " |      >>> np.add.identity\n",
      " |      0\n",
      " |      >>> np.multiply.identity\n",
      " |      1\n",
      " |      >>> np.power.identity\n",
      " |      1\n",
      " |      >>> print(np.exp.identity)\n",
      " |      None\n",
      " |  \n",
      " |  nargs\n",
      " |      The number of arguments.\n",
      " |      \n",
      " |      Data attribute containing the number of arguments the ufunc takes, including\n",
      " |      optional ones.\n",
      " |      \n",
      " |      Notes\n",
      " |      -----\n",
      " |      Typically this value will be one more than what you might expect because all\n",
      " |      ufuncs take  the optional \"out\" argument.\n",
      " |      \n",
      " |      Examples\n",
      " |      --------\n",
      " |      >>> np.add.nargs\n",
      " |      3\n",
      " |      >>> np.multiply.nargs\n",
      " |      3\n",
      " |      >>> np.power.nargs\n",
      " |      3\n",
      " |      >>> np.exp.nargs\n",
      " |      2\n",
      " |  \n",
      " |  nin\n",
      " |      The number of inputs.\n",
      " |      \n",
      " |      Data attribute containing the number of arguments the ufunc treats as input.\n",
      " |      \n",
      " |      Examples\n",
      " |      --------\n",
      " |      >>> np.add.nin\n",
      " |      2\n",
      " |      >>> np.multiply.nin\n",
      " |      2\n",
      " |      >>> np.power.nin\n",
      " |      2\n",
      " |      >>> np.exp.nin\n",
      " |      1\n",
      " |  \n",
      " |  nout\n",
      " |      The number of outputs.\n",
      " |      \n",
      " |      Data attribute containing the number of arguments the ufunc treats as output.\n",
      " |      \n",
      " |      Notes\n",
      " |      -----\n",
      " |      Since all ufuncs can take output arguments, this will always be (at least) 1.\n",
      " |      \n",
      " |      Examples\n",
      " |      --------\n",
      " |      >>> np.add.nout\n",
      " |      1\n",
      " |      >>> np.multiply.nout\n",
      " |      1\n",
      " |      >>> np.power.nout\n",
      " |      1\n",
      " |      >>> np.exp.nout\n",
      " |      1\n",
      " |  \n",
      " |  ntypes\n",
      " |      The number of types.\n",
      " |      \n",
      " |      The number of numerical NumPy types - of which there are 18 total - on which\n",
      " |      the ufunc can operate.\n",
      " |      \n",
      " |      See Also\n",
      " |      --------\n",
      " |      numpy.ufunc.types\n",
      " |      \n",
      " |      Examples\n",
      " |      --------\n",
      " |      >>> np.add.ntypes\n",
      " |      18\n",
      " |      >>> np.multiply.ntypes\n",
      " |      18\n",
      " |      >>> np.power.ntypes\n",
      " |      17\n",
      " |      >>> np.exp.ntypes\n",
      " |      7\n",
      " |      >>> np.remainder.ntypes\n",
      " |      14\n",
      " |  \n",
      " |  signature\n",
      " |      Definition of the core elements a generalized ufunc operates on.\n",
      " |      \n",
      " |      The signature determines how the dimensions of each input/output array\n",
      " |      are split into core and loop dimensions:\n",
      " |      \n",
      " |      1. Each dimension in the signature is matched to a dimension of the\n",
      " |         corresponding passed-in array, starting from the end of the shape tuple.\n",
      " |      2. Core dimensions assigned to the same label in the signature must have\n",
      " |         exactly matching sizes, no broadcasting is performed.\n",
      " |      3. The core dimensions are removed from all inputs and the remaining\n",
      " |         dimensions are broadcast together, defining the loop dimensions.\n",
      " |      \n",
      " |      Notes\n",
      " |      -----\n",
      " |      Generalized ufuncs are used internally in many linalg functions, and in\n",
      " |      the testing suite; the examples below are taken from these.\n",
      " |      For ufuncs that operate on scalars, the signature is `None`, which is\n",
      " |      equivalent to '()' for every argument.\n",
      " |      \n",
      " |      Examples\n",
      " |      --------\n",
      " |      >>> np.core.umath_tests.matrix_multiply.signature\n",
      " |      '(m,n),(n,p)->(m,p)'\n",
      " |      >>> np.linalg._umath_linalg.det.signature\n",
      " |      '(m,m)->()'\n",
      " |      >>> np.add.signature is None\n",
      " |      True  # equivalent to '(),()->()'\n",
      " |  \n",
      " |  types\n",
      " |      Returns a list with types grouped input->output.\n",
      " |      \n",
      " |      Data attribute listing the data-type \"Domain-Range\" groupings the ufunc can\n",
      " |      deliver. The data-types are given using the character codes.\n",
      " |      \n",
      " |      See Also\n",
      " |      --------\n",
      " |      numpy.ufunc.ntypes\n",
      " |      \n",
      " |      Examples\n",
      " |      --------\n",
      " |      >>> np.add.types\n",
      " |      ['??->?', 'bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I', 'll->l',\n",
      " |      'LL->L', 'qq->q', 'QQ->Q', 'ff->f', 'dd->d', 'gg->g', 'FF->F', 'DD->D',\n",
      " |      'GG->G', 'OO->O']\n",
      " |      \n",
      " |      >>> np.multiply.types\n",
      " |      ['??->?', 'bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I', 'll->l',\n",
      " |      'LL->L', 'qq->q', 'QQ->Q', 'ff->f', 'dd->d', 'gg->g', 'FF->F', 'DD->D',\n",
      " |      'GG->G', 'OO->O']\n",
      " |      \n",
      " |      >>> np.power.types\n",
      " |      ['bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I', 'll->l', 'LL->L',\n",
      " |      'qq->q', 'QQ->Q', 'ff->f', 'dd->d', 'gg->g', 'FF->F', 'DD->D', 'GG->G',\n",
      " |      'OO->O']\n",
      " |      \n",
      " |      >>> np.exp.types\n",
      " |      ['f->f', 'd->d', 'g->g', 'F->F', 'D->D', 'G->G', 'O->O']\n",
      " |      \n",
      " |      >>> np.remainder.types\n",
      " |      ['bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I', 'll->l', 'LL->L',\n",
      " |      'qq->q', 'QQ->Q', 'ff->f', 'dd->d', 'gg->g', 'OO->O']\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(np.log1p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 216,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4.0"
      ]
     },
     "execution_count": 216,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.exp(np.log1p(3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
